miniature-advantage-31279
10/23/2021, 3:20 AMconst vpc = awsx.ec2.Vpc.fromExistingIds(name, { vpcId: props.vpcId });
console.log(await vpc.publicSubnetIds);
However if I create a new vpc, it will return the correct public subnet IDs, it seems there is missing initialisation internally if we are using fromExistingIds?const vpc = awsx.ec2.Vpc.fromExistingIds(name, {
vpcId: props.vpcId, vpcPublicSubnetIds: publicSubnets.ids, });
millions-furniture-75402
10/23/2021, 5:35 PMconst publicSubnets = await aws.ec2.getSubnetIds({
vpcId: vpcId,
filters: [{ name: 'tag:type', values: ['public'] }],
});
const privateSubnets = await aws.ec2.getSubnetIds({
vpcId: vpcId,
filters: [{ name: 'tag:type', values: ['private'] }],
});
awsx.ec2.Vpc.fromExistingIds(name, {
vpcId: vpcId,
publicSubnetIds: publicSubnetIds,
privateSubnetIds: privateSubnetIds,
});
broad-gold-44713
10/23/2021, 6:19 PMconst vpc = new awsx.ec2.Vpc('appVpc', { vpcId: props.vpcId })
miniature-advantage-31279
10/25/2021, 1:52 PM