Is there a way to use a StackReference in the Pulu...
# automation-api
c
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
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