ec2-alpha: Allow creation of IPv6-only subnets
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
When creating a new `SubnetV2`, the developer can choose to create an IPv6-only ("native") subnet.
### Use Case
I don't know how to currently do this on CDK level besides dropping down to L1 constructs. Both V1 and V2 of the VPC/Subnet CDK L2 constructs force me to provide IPv4 blocks to subnets. (E.g. [ec2-alpha SubnetV2 ipv4CidrBlock parameter is required](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.SubnetV2.html#ipv4cidrblockspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan))
### Proposed Solution
The aim is to generate CloudFormation that looks something like [this example](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#aws-resource-ec2-subnet--examples--Subnet_with_an_IPv6_CIDR):
```yaml
mySubnet:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref myVPC
Ipv6Native: true
Ipv6CidrBlock: !Select [ 0, !Cidr [ !Select [ 0, !GetAtt myVpc.Ipv6CidrBlocks], 1, 64 ]]
AssignIpv6AddressOnCreation: true
```
### Other Information
Possibly part of https://github.com/aws/aws-cdk/issues/30762
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### AWS CDK Library version (aws-cdk-lib)
aws-cdk-lib@2.199.0
### AWS CDK CLI version
2.1016.1 (build 6de56b2)
### Environment details (OS name and version, etc.)
Generic
Contributor guide
Research direction
Start by reading the ec2-alpha SubnetV2 entry point and the AWS::EC2::Subnet example linked in the issue, comparing the required ipv4CidrBlock with the Ipv6Native and Ipv6CidrBlock properties. Done means SubnetV2 can represent an IPv6-only subnet and synthesize the corresponding CloudFormation properties without requiring an IPv4 block.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100