-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(ec2): add ipv6CidrBlockCreated property to VPC for IPv6 CIDR block dependency #36745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…k dependency Closes aws#36714. When using a dual-stack VPC and referencing vpc.vpcIpv6CidrBlocks to create dependent resources (like security groups), CloudFormation deployments may fail with race conditions because there's no explicit dependency on the AWS::EC2::VPCCidrBlock resource. This change adds a new ipv6CidrBlockCreated: IDependable property to the VPC construct that allows users to establish a dependency on the IPv6 CIDR block being allocated before creating resources that reference vpcIpv6CidrBlocks. Usage: const vpc = new Vpc(this, 'VPC', { ipProtocol: IpProtocol.DUAL_STACK }); const sg = new SecurityGroup(this, 'SG', { vpc }); sg.addIngressRule(Peer.ipv6(Fn.select(0, vpc.vpcIpv6CidrBlocks)), Port.tcp(443)); sg.node.addDependency(vpc.ipv6CidrBlockCreated); - Added ipv6CidrBlockCreated property to IVpc interface - Added ipv6CidrBlockCreated property to VpcBase abstract class - Implemented ipv6CidrBlockCreated in Vpc class with DependencyGroup - Added ipv6CidrBlockCreated to ImportedVpc and LookedUpVpc (empty DependencyGroup) - Added 5 unit tests - Added integration test
…lock dependency - Add abstract `ipv6CidrBlockCreated` property to VpcV2Base class - Implement `ipv6CidrBlockCreated` property in VpcV2 class as IDependable - Initialize `ipv6CidrBlockCreated` as empty DependencyGroup in VpcV2 constructor - Add comprehensive JSDoc comments explaining IPv6 CIDR block dependency behavior - Enable consumers to depend on IPv6 CIDR block allocation for proper resource ordering
|
|
||||||||||||||
|
|
||||||||||||||
…pshots - Update CloudFormation template hash and asset references in snapshot files - Add guard suppression rule for EC2_NO_OPEN_SECURITY_GROUPS in security group metadata - Expand analytics data in manifest.json with detailed construct configuration properties - Replace wildcard analytics data with explicit property values for VPC and subnet constructs - Update manifest version from 49.0.0 to 50.0.0 - Regenerate snapshots to reflect changes in IPv6 CIDR block dependency test
Issue # (if applicable)
Closes #36714.
Reason for this change
When using a dual-stack VPC and referencing
vpc.vpcIpv6CidrBlocksto create dependent resources (like security groups), CloudFormation deployments may fail with race conditions because there's no explicit dependency on theAWS::EC2::VPCCidrBlockresource. Users experience intermittent deployment failures with:The workaround required internal knowledge of the construct:
Description of changes
Added a new
ipv6CidrBlockCreated: IDependableproperty to the VPC construct that allows users to establish a dependency on the IPv6 CIDR block being allocated before creating resources that referencevpcIpv6CidrBlocks.ipv6CidrBlockCreatedproperty toIVpcinterfaceipv6CidrBlockCreatedproperty toVpcBaseabstract classipv6CidrBlockCreatedinVpcclass withDependencyGroupthat contains the IPv6 CIDR block resourceipv6CidrBlockCreatedtoImportedVpcandLookedUpVpcclasses (emptyDependencyGroup)internetConnectivityEstablishedpatternUsage Example:
This is NOT a breaking change - this is an additive change that does not affect existing behavior.
Describe any new or updated permissions being added
N/A - No IAM permission changes.
Description of how you validated changes
vpc.test.ts:ipv6CidrBlockCreated is defined for dual-stack VPCsipv6CidrBlockCreated is defined for IPv4-only VPCs (empty DependencyGroup)resources depending on ipv6CidrBlockCreated have correct DependsOn for dual-stack VPCsresources depending on ipv6CidrBlockCreated have no DependsOn for IPv4-only VPCsimported VPCs have ipv6CidrBlockCreated property (empty DependencyGroup)integ.vpc-ipv6-cidr-block-dependency.tsthat:vpc.vpcIpv6CidrBlocksvpc.ipv6CidrBlockCreatedto prevent the race conditionDependsOnis correctly set in CloudFormationChecklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license