worried-lunch-10568
09/20/2021, 10:53 AMclass Program
{
static async Task<int> Main(string[] args)
{
var stack = new Pulumi.StackReference("path to stack");
I get error
Unhandled exception. System.InvalidOperationException: Trying to acquire Deployment.Instance before 'Run' was called.
at Pulumi.Deployment.get_Instance()
at Pulumi.Deployment.get_InternalInstance()
at Pulumi.Resource..ctor(String type, String name, Boolean custom, ResourceArgs args, ResourceOptions options, Boolean remote, Boolean dependency)
at Pulumi.CustomResource..ctor(String type, String name, ResourceArgs args, CustomResourceOptions options, Boolean dependency)
at Pulumi.CustomResource..ctor(String type, String name, ResourceArgs args, CustomResourceOptions options)
at Pulumi.StackReference..ctor(String name, StackReferenceArgs args, CustomResourceOptions options)
at Program.Main(String[] args) in C:\...\Program.cs:line 34
at Program.<Main>(String[] args)
brave-planet-10645
09/20/2021, 11:25 AMStack
StackReference
to get stack information, you use it to access outputs from one stack in another: https://www.pulumi.com/docs/intro/concepts/stack/#stackreferencesworried-lunch-10568
09/20/2021, 12:19 PMgetVirtualNetwork
method and get existing subnets to calculate next cidr block and then use that cidr block as input for another Stack.
If stack references are not designed to be used like that is there the right way for this case?brave-planet-10645
09/20/2021, 12:59 PMgetVirtualNetwork
method and to get the address blocksworried-lunch-10568
09/21/2021, 4:52 AMgetVirtualNetwork
as part of the automation script but couldn't figure this out. I hope it's clearer what I'm trying to achieve herered-match-15116
09/21/2021, 3:02 PMworried-lunch-10568
09/22/2021, 7:04 AM