<@U01R1HT1U8G> It's not built-in to Pulumi, so I h...
# azure
f
@worried-knife-31967 It's not built-in to Pulumi, so I had to implement this myself in the past. Here's the code I used! It's not commented or anything, but hopefully it's reasonably self-explanatory. To invoke it, you just need to use an
Output.Tuple()
containing all the parameters, then inside the
.Apply(tuple =>
lambda, invoke the method using standard
async
and
await
methods. I haven't tested it in a while, but it should just work!
w
I was going to do something similar, my issue is that it uploads on every run that way, not just if the file has changed. it would be cool to be able to have some kind of extension to FileAsset that would do that.
f
I want to think that
FileAsset
actually does do that. I've observed
FileAsset
mentioning gathering file hashes in the past, which is why I think that. I bet you could probably write a small custom provider wrapper around this code that makes use of
FileAsset
to implement that functionality. But, if you're okay with uploading the file every time you run
pulumi up
, then this'll cover you 🙂
w
I'm now playing with Pulumi Command... it would be great to have that, but it accepts a method to run, or an API to call.