How to create subnets in 3 AZs of ap-northeast-2 region ? #14557
-
Hello, It seems that it is not possible to create subnets in all multiple Availability Zones.
Please refer to the below my cdk code. this.vpc_vpc_main = new ec2.Vpc(this, "vpc-vpc-main", {
cidr: "10.137.0.0/16",
maxAzs: 3,
natGateways: 1,
subnetConfiguration: [
{
name: "vpc-subnet-main",
subnetType: ec2.SubnetType.PUBLIC,
cidrMask: 20,
},
{
name: "vpc-subnet-instance",
subnetType: ec2.SubnetType.PRIVATE,
cidrMask: 20,
},
{
name: "vpc-subnet-rds",
subnetType: ec2.SubnetType.ISOLATED,
cidrMask: 20,
},
{
name: "vpc-subnet-lambda",
subnetType: ec2.SubnetType.PRIVATE,
cidrMask: 20,
},
],
}); I expected that 4 subnets would be created in each of the 3 Availability Zones. For reference, the reason I'm trying to create subnets in the 2c availability zone is that ap-northeast-2a and ap-northeast-2c are required for the subnet group required when creating aurora serverless. Any idea to create subnets in ap-northeast-2c available zone ? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
If you want to use all AZs of a region set maxAzs to a highter number than the number of AZs in the region. So you can set maxAzs to 99 for exemple |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
If you want to use all AZs of a region set maxAzs to a highter number than the number of AZs in the region. So you can set maxAzs to 99 for exemple