Hi, I try to read exports from one established sta...
# golang
s
Hi, I try to read exports from one established stack and try ot reuse it in another one. reading the exported output and reusing them worked well. On the next iteration I tried to shape a type around those output values by resolving the outputs, assign those to fields in the new type and return it as a pulumi.Output with the following snippet:
Copy code
func getBaseReferences(ctx *pulumi.Context) (pulumi.Output, error) {
	fmt.Println("base stack output")
	baseStack, err := pulumi.NewStackReference(ctx, "base", nil)
	if err != nil {
		return nil, err
	}

	vpcID := baseStack.GetStringOutput(pulumi.String("vpc"))
	if err != nil {
		return nil, err
	}

	publicSubnets := baseStack.GetOutput(pulumi.String("publicSubnets"))
	if err != nil {
		return nil, err
	}

	privateSubnets := baseStack.GetOutput(pulumi.String("privateSubnets"))
	if err != nil {
		return nil, err
	}

  result := pulumi.All(vpcID, publicSubnets, privateSubnets).ApplyT(func(args []interface{}) (*Vpc, error) {
		vpc := args[0].(string)
		publicSubnets := args[1].([]interface{})
		privateSubnets := args[2].([]interface{})
		priv := convert(privateSubnets)
		pub := convert(publicSubnets)

		return &Vpc{VpcID: vpc, Subnets: Subnets{Public: pub, Private: priv}}, nil
	})
	return result, nil
}
The pulumi.All part does not seem to get invoked. What am I missing here?