sparse-intern-71089
06/23/2021, 5:51 AMbored-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 likebored-oyster-3147
06/23/2021, 12:48 PMnew[] {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.No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by