Open syangdh opened 5 days ago
Hi @syangdh , thanks for reaching out. I tried to deploy the VPC in the us-west-2 region and 9 subnets were successfully created. Sharing the code snippet in typescript (deplying in python meanwhile) and Subnets snapshot -
const vpc = new ec2.Vpc(this, 'Ecissue01Vpc', {
ipAddresses :ec2.IpAddresses.cidr('10.0.0.0/16'),
maxAzs: 3,
natGateways: 1,
subnetConfiguration: [
{
cidrMask: 24,
name: 'public',
subnetType: ec2.SubnetType.PUBLIC,
},
{
cidrMask: 24,
name: 'private',
subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
},
{
cidrMask: 24,
name: 'isolated',
subnetType: ec2.SubnetType.PRIVATE_ISOLATED
}]
});
const app = new cdk.App();
new Ecissue01Stack(app, 'Ecissue01Stack', {
env: { account: '************', region: 'us-west-2' },
});
Subnets created in us-west-2 -
Could you please check the code and see if something is missing from your side?
works well for python as well - 9 subnets created -
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Describe the bug
I am trying to create a VPC with 3 AZs, but it turns out it only used 2 AZ, i.e., only have 6 subnets instead of 9 subnets
Expected Behavior
It should have created 9 subnets, but instead it created 6 subnets (My region is us-west-2)
Current Behavior
only 2 Az were used for the subnet creation
Reproduction Steps
Code is posted above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.147.1 (build d3695d4)
Framework Version
No response
Node.js Version
v22.2.0
OS
mac OS
Language
Python
Language Version
Python
Other information
No response