Hi all, I have simple use-case but it become harde...
# general
s
Hi all, I have simple use-case but it become harder 😞 I use RandomPassword to generate password and save it into variable
user_password = RandomPassword().result
the variable ‘user_password’ I sent to my dynamic resource which only create a query with the ‘user_password’ inside (Eventually is a string ) the problem is that the value is the Object itself
<pulumi.output.Output at 0x7ffe81ffe6d0>
is there a way to export the value i get from randomPassword into a string in run time? 😢 Thanks!
b
you'll need to resolve the output with an apply
s
Hi @billowy-army-68599 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?
b
Yes this is possible, do you have code? You just want to write the file to disk? Which language?
s
Hi @billowy-army-68599 just want to write here (if anyone also will encounter this ) that this blog helped me to understand the
apply()
better and I was able to do it with
Copy code
script = user_data_password.apply(
                lambda db_user_password: script_str.format(password=db_user_password))
Eventually script is output that sent to a pulumi resource
❤️ 1