If I have one stack exporting a `[]string` , in th...
# golang
b
If I have one stack exporting a
[]string
, in the importing stack it will be a StringArrayOutput. Two questions: 1. What’s the right way to import this, given the
stackRef.GetOutput(...)
returns an
AnyOutput
? What’s the best way to make it a
StringArrayOutput
? 2. Is there any way to iterate over the values in there as
StringOutput
? e.g. say I want to make a new
StringArrayOutput
that is the result of running
pulumi.Sprintf
on the individual items in the array, can I do that? I really hope I don’t have to do this in an
ApplyT
, because it’s going to be very painful.
To make (2) more fun, I need to export the result of these of these values (which would be a
pulumi.Sprintf
), and I don’t believe I can run an export from within an
ApplyT
b
Did you end up figuring this out?
b
I figured 1 out, but not 2. I had a recent longer discussion here, but short answer is you should really try and avoid it 😀
I can find the code for 1 if it's helpful.