I would like to get a Pulumi secret value from my ...
# general
l
I would like to get a Pulumi secret value from my config and use it as a string in my code. Is that at all possible? I've been banging my head trying to figure out how to do this for hours.
apply
does not seem to convert
Output[str]
despite documentation and everyone on the internet saying this is the way to accomplish this... I'm working in Python, Btw.
In order to avoid the XY problem, I'll also say that what I'm trying to do is download a ZIP file from the internet as a
pulumi.FileAsset
, but the ZIP file requires some Authorization.
And to take it even a step further back -- REALLY what I want to do is initialize a GCP cloud function from a github repository
b
apply
does not seem to convert
Output[str]
Apply doesn’t convert an
Output[str]
it waits for the value to be returned, then does something with it. What do you have so far? You like want to do:
Copy code
value.apply(lambda v: //download the file here)
l
brilliant, thank you!
that worked lovely
b
I updated the inputs and outputs doc yesterday, you may consider reading it and seeing if it’s easier to grok now https://www.pulumi.com/docs/concepts/inputs-outputs/
l
thank you!
Is there a way to easily cleanup the downloaded file after Pulumi up runs?
b
No there’s no post run callback, I’d just download the file into a temporary directory tbh
l
that's what I'm doing but still 😛 having init and cleanup hooks would be reaaaally nice