https://pulumi.com logo
Title
c

cuddly-smartphone-15267

02/17/2023, 2:11 AM
we have a scenario where we either point to an existing (AWS) Vpc or create a new one. I need to pass the subnet IDs to another piece of code in the 'existing' case, i need to look up the subnet IDs... which i can do using
await aws.ec2.getSubnetIdsOutput({vpcId: predefined.vpcId});
and it returns an object with an
ids
property of type:
Output<string[]>
in the case of pulumi managed (awsx) VPC, the vpc object has a
privateSubnetIds
property with a type of
Output<string>[]
... any idea how to convert them both into the same type? ie, either convert
Output<string[]>
into
Output<string>[]
or visa versa
e

echoing-dinner-19531

02/17/2023, 9:42 AM
You can turn an
Output<string>[]
into an
Output<string[]>
with the all function: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/#all The other way round is not possible.
c

cuddly-smartphone-15267

02/20/2023, 12:50 AM
thanks Fraser 👍