https://pulumi.com logo
Title
f

future-nail-59564

02/12/2021, 3:18 PM
Hey folks, quick question: How can I convert an actual string into an
Output<string>
? I have a custom component that returns a string output: in some cases it will return an output from a child resource, but in some cases the value will be known immediately/synchronously and I want to return it in the same output property. What’s the simplest syntax to return such a string as output?
Never mind, I found it! It was not obvious in the doc, but by inspecting the code I found
Output.create(…)
. Thanks anyway! 👍
w

witty-candle-66007

02/12/2021, 4:24 PM
I believe `pulumi.interpolate`will also result in an Output<string>.
m

miniature-musician-31262

02/13/2021, 12:52 AM
l

little-cartoon-10569

02/14/2021, 7:37 AM
pulumi.output
would be my preferred choice.
const o: pulumi.Input<string> = pulumi.output(i);