colossal-vr-62639
06/23/2021, 5:51 AMreturn new Dictionary<string, object?>()
{
{
"subnets-public",
new[] {componentOne.PublicSubnet0.Apply(x => x.Id), componentOne.PublicSubnet1.Apply(x => x.Id)}
},
};
and then in some other project, read the outputs from the stack...
var subnets = stack.GetOutput("subnets-public")
bored-oyster-3147
06/23/2021, 12:42 PMOutput<string>
into Output<string[]>
it would be:
var subnetIdArray = Output.Tuple(componentOne.PublicSubnet0, componentOne.PublicSubnet1).Apply((subnet0, subnet1) => {
return new[] { subnet0.Id, subnet1.Id };
});
And then you could do:
return new Dictionary<string, object?>()
{
["subnets-public"] = subnetIdArray,
};
But I've never personally tried to output an array, I've always kept it string:string
. So not sure what var subnets = stack.GetOutput("subnets-public")
will look likenew[] {componentOne.PublicSubnet0.Apply(x => x.Id), componentOne.PublicSubnet1.Apply(x => x.Id)}
is giving you Output<string>[]
instead of Output<string[]>
. So you need to use .Tuple(...)
to merge your outputs.