I have few private subnets in my VPC and i'm trying to import them using typescript as shown below:
vpc1 = ec2.Vpc.fromLookup(this, 'myVpc',{isDefault: false, vpcId:vpcId });
// Iterate the private subnets
const selection = vpc1.selectSubnets({
subnetType: ec2.SubnetType.PRIVATE
});
for (const subnet of selection.subnets) {
}
I managed to import the VPC. But, the private subnets are not listed.
How can this be done ?
