https://pulumi.com logo
#automation-api
Title
# automation-api
c

colossal-vr-62639

07/22/2021, 7:27 AM
Is there a way to use a StackReference in the Pulumi Automation API? When I attempt to initialize a new StackReference, it complains at runtime
Copy code
Trying to acquire Deployment.Instance before 'Run' was called.
b

bored-oyster-3147

07/22/2021, 1:04 PM
can you show a code sample of your StackReference usage?
it needs to be inside your pulumi program, so the instantiation should be inside the pulumi program delegate (that isn't executed until pulumi execution starts) or inside your
Pulumi.Stack
constructor (which isn't instantiated until pulumi execution starts). The error you're seeing I would expect if you newed a StackReference outside of a pulumi program context.
☝️ 1
3 Views