What's the intended convention when you have a sin...
# dotnet
a
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
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
RequireOutput returns an
Output<object>
whilst the
Apply
returns an
Output<string>
. The former is rejected by
Input<string>
t
Ah, you are right, my bad
a
Are there plans for StackRef to act more like
Config
and allow the type to be specified?