https://pulumi.com logo
Title
a

adventurous-garage-59192

01/20/2020, 12:59 PM
What's the intended convention when you have a single StackReference value you want to use in C#? The
Output<object>
return from
RequireOutput
is fine if you're using
Output.Format
or related, but isn't so great if you just want to grab it and pass it as-in into some property. The two options seem to be
(string)await infra.RequireValueAsync(".....")
or
infra.RequireOutput(".....").Apply(x=> (string)x);
. As a side note, the docs still say that SR isn't available in C# yet.
t

tall-librarian-49374

01/20/2020, 1:05 PM
The last option doesn’t make sense, it’s the same thing as
RequireOutput
. You should be able to pass an output to any resource property downstream. If you need to make decisions, like use the value in
if
statements, than
await RequireValueAsync
should be the easiest.
a

adventurous-garage-59192

01/20/2020, 1:49 PM
RequireOutput returns an
Output<object>
whilst the
Apply
returns an
Output<string>
. The former is rejected by
Input<string>
t

tall-librarian-49374

01/20/2020, 1:59 PM
Ah, you are right, my bad
a

adventurous-garage-59192

01/20/2020, 2:18 PM
Are there plans for StackRef to act more like
Config
and allow the type to be specified?