aws / aws/aws-cdk

aws-ec2: Support availabilityZoneId for Vpc Construct

Open
#28,265 3 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/aws-ec2 effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

The [Vpc Construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html) supports the [availabilityZones](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html#availabilityzones) prop. We would like to be able to specify the [availabilityZoneIds](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html) as well.

### Use Case

Since the AZ mapping for each AWS account is random (at least for older regions), we would like to be able to consistently specify the AZs that our VPC is in. The [CfnSubnet](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnSubnet.html#availabilityzoneid) construct supports the use of `availabilityZoneId`. We would like the Vpc construct to similarly support `availabilityZoneIds`.

### Proposed Solution

_No response_

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.113.0

### Environment details (OS name and version, etc.)

AL2

Contributor guide

Open the contributing guide

Research direction

The issue names the Vpc Construct and CfnSubnet's availabilityZoneId as the relevant entry points. Start by tracing how Vpc consumes availabilityZones and compare the expected account-independent behavior with CfnSubnet; done means Vpc accepts availabilityZoneIds and produces subnets in those IDs without breaking existing availabilityZones behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.