most-lighter-95902
11/24/2021, 5:23 AMStackReference
doesn’t seem to work inside Automation API (at least when it’s not run inside the same program) - is this expected? If it’s not available, what options do I have for accessing another stack’s outputs?proud-pizza-80589
11/24/2021, 8:28 AMcrooked-pillow-11944
11/24/2021, 12:22 PMbored-oyster-3147
11/24/2021, 1:52 PMmost-lighter-95902
11/24/2021, 4:31 PMconst clusterStackRef = new pulumi.StackReference('<org>/<project>/cluster')
const clusterName = clusterStackRef.getOutput('clusterName').apply(t => console.log(t))
undefined
bored-oyster-3147
11/24/2021, 5:07 PMmost-lighter-95902
11/24/2021, 5:18 PMLocalWorkspace.createOrSelectStack
and stack.up
is being called) multiple times in sequence to set up multiple stacksrun('cluster')
run('cluster_autoscaler')
run('db')
run('app')
...
pulumi stack ls
the created stacks show up fineStackReference
should work then?StackReference
inside the program (i.e. program
arg of await LocalWorkspace.createOrSelectStack
). That’s supposed to work assuming this local setup, correct?pulumi stack ls
shows all stacks so maybe this is just a UI thingundefined
. Thanks for looking into this!bored-oyster-3147
11/24/2021, 6:38 PMmost-lighter-95902
11/24/2021, 10:55 PMPromise<pulumi.Output<string>[]>
). But when I do a StackReference.getOutput
, the type is pulumi.Output<any>
. I can’t seem to use as pulumi.Output<string>[]
on this, so what’s the best practice in keeping the type consistent when using StackReference
outputs?bored-oyster-3147
11/24/2021, 10:57 PMmost-lighter-95902
11/24/2021, 10:59 PMpulumi.Output<string>[]
not an output of a string array?StackReference.getOutput
seems to output pulumi.Output<any>
- am I wrong?bored-oyster-3147
11/24/2021, 11:03 PMpulumi.Output<string>[]
is an array of string outputs. pulumi.Output<string[]>
would be an output of string array. See the difference?most-lighter-95902
11/24/2021, 11:21 PMStackReference
and the stack doesn’t exist yet, it throws an error and I’m not sure what the best way would be to handle itbored-oyster-3147
11/25/2021, 4:43 AMmost-lighter-95902
11/25/2021, 4:57 AMnew pulumi.StackReference
in the same program right? You can only instantiate it once?crooked-pillow-11944
11/25/2021, 1:36 PMmost-lighter-95902
11/26/2021, 3:48 AMnew StackReference
more than once:error: resource 'urn:pulumi:app-staging::ckc-test::pulumi:pulumi:StackReference::seunggs/ckc-test/app-build' registered twice (read and read)
bored-oyster-3147
12/04/2021, 4:15 AM