Repository navigation
feat(ec2): support IPv6 IPAM allocation for Subnet - #39752
gauranshahuja wants to merge 1 commit into
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
The pull request linter fails with the following errors:
❌ Features must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.
✅ A exemption request has been requested. Please wait for a maintainer's review.
|
Automated review A maintainer will still review this — treat the notes below as a starting point. 📌 Commit This PR adds IPv6 IPAM allocation support to the 🔴 1 blocking · 🟡 0 recommended · ⚪ 0 optional Files with findings (1)
Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews. |
There was a problem hiding this comment.
See the review summary comment for the overview; the notes below are inline.
| assignIpv6AddressOnCreation: true, | ||
| }); | ||
|
|
There was a problem hiding this comment.
🔴 Blocking — This PR adds a new integration test integ.subnet-ipv6-ipam.ts but no companion integ.subnet-ipv6-ipam.js.snapshot/ directory, while every neighboring integ test in this folder (e.g. integ.subnet-ipam, integ.vpc-ipam) has one. The snapshot is the synthesized Cloud Assembly that the build compares against on every run, so without it the test has no regression baseline and the committed test does not prove it deploys. The feature owes an integration test here because it exposes the previously-unused CloudFormation properties Ipv6IpamPoolId/Ipv6NetmaskLength and introduces a Custom Resource (INTEGRATION_TESTS.md#what-are-cdk-integration-tests).
Suggested change: Deploy the test against a real AWS account (not synth-only) and commit the resulting snapshot, e.g. yarn integ --update-on-failed integ.subnet-ipv6-ipam.js. This also needs to confirm the behavior the author flagged as unverified — that the IPv6 resource-planning pool belongs in the public default scope (ipam.attrPublicDefaultScopeId). This feature owes the integ test, so a deployed snapshot is required rather than an integ-test exemption.
|
Exemption Request: I don't have an AWS account to deploy integration tests, so the |
Issue # (if applicable)
Closes #39750.
Reason for this change
AWS::EC2::Subnetcan allocate its IPv6 CIDR block from an Amazon VPC IP Address Manager pool (Ipv6IpamPoolId+Ipv6NetmaskLength), but the L2Subnetconstruct only accepts a concreteipv6CidrBlock. #38810 added IPv4 IPAM allocation (ipv4IpamAllocation); this adds the IPv6 counterpart, as discussed there when the IPv4 struct was namedSubnetIpv4IpamAllocation.Description of changes
SubnetIpv6IpamAllocation({ ipamPool: IIPAMPoolRef, netmaskLength: number }) next toSubnetIpv4IpamAllocation.SubnetProps.ipv6IpamAllocation, rendered asIpv6IpamPoolId/Ipv6NetmaskLengthon theCfnSubnet.ipv6CidrBlockandipv6IpamAllocationcannot both be set; a concretenetmaskLengthmust be between 44 and 64 in increments of 4 (subnet sizing for IPv6). Token values are passed through.subnetIpv6CidrBlocksalready reads the deploy-timeIpv6CidrBlocksattribute, so it returns the allocated block without changes.integ.subnet-ipv6-ipam.ts: dual-stack VPC, IPv6 resource planning pool in the IPAM public default scope (Amazon-provided IPv6 is public), subnet withipv6IpamAllocation/64, assertion that the subnet gets a /64 IPv6 block.Describe any new or updated permissions being added
None.
Description of how you validated changes
aws-ec2/test/vpc.test.tsfor the rendered properties, a pool in the same stack, IPv4 + IPv6 IPAM together,subnetIpv6CidrBlocks,PublicSubnet/PrivateSubnet, token netmask, both-set error, and the netmask range (/40, /43, /46, /62, /65, /68 rejected; /44 to /64 in steps of 4 accepted).aws-cdk-lib(eslint + awslint),jest aws-ec2/test/vpc.test.ts,yarn test aws-ec2andjsii-diffagainst 2.277.0 withallowed-breaking-changes.txtpass in a fork-only workflow: https://github.com/gauranshahuja/aws-cdk/actions/runs/43837107193Exemption Request: I could not deploy the integration test (no AWS account available), so the snapshot for
integ.subnet-ipv6-ipam.tsis not included. It follows the structure ofinteg.subnet-ipam.ts; the one part I could not confirm without a deployment is the scope of the IPv6 planning pool (public default scope for an Amazon-provided VPC IPv6 CIDR). Happy to adjust it.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license