https://pulumi.com logo
#general
Title
# general
c

clever-glass-42863

04/27/2022, 9:07 PM
What is the best way to handle multiple (Output<>) variable interpolation into a string. We are building a container definition set with multiple containers are have properties such as imageName and environment variables driven from Output of various resource types. What is the "Pulumi" way to handling this case of merging all the results of those properties into the final string. A hacky workaround we have now is to create a Task<> around the result of the .Apply<> call, but this seems to create some scenarios of unexpected hangs. Any help would be appreciated!
l

little-cartoon-10569

04/27/2022, 9:21 PM
You can use
pulumi.all()
, which is the most generic way, but also very verbose. If you're just looking to create an
Output<string>
from other `Output<string>`s, then
pulumi.interpolate
is the sugar on top, to make it more readable.
c

clever-glass-42863

04/27/2022, 9:23 PM
I decided to re-read the documentation. What I was missing was the
Output.Tuple<...>
which allows for various data types; which is effectively what I needed. Thanks!
👍 1
6 Views