This message was deleted.
# getting-started
s
This message was deleted.
l
There is, but you probably shouldn't use it. You can use the
apply()
method on the output, which takes a function as a parameter, and the password value will be available inside that function (but not at the top level).
However, this is rarely necessary. Can you explain or show in code how you want to use this password? Generally, you can pass the output value into other Pulumi resources, and let them handle the extraction of the string from the output.
s
Hi @little-cartoon-10569, I want to use a random password resource with pulumi and send it as string to other function that should read this and put in file I tried to use with apply but unfortunately none of the tries succeed. do you able to solve any kind of this similar issue?
l
You cannot pass it as a string to another function, except from within an apply. And ideally you should not do that. What sort of function takes the password parameter? If it is a Pulumi constructor, you don't need a string, the output will do fine. If it is anything else, you should either change it (to be a Pulumi constructor), or use an apply. There are many examples of using apply, in the documentation and in the examples repo (https://github.com/Pulumi/examples).