Skip to content

Commit 9de77bb

Browse files
fix(ec2): deploying an isolated subnet fails when ipv6AssignAddressOnCreation is set to true (#28902)
This PR resolves the issue where deploying an isolated subnet with `ipv6AssignAddressOnCreation` enabled fails. ### example ```ts new Vpc(stack, 'TheVPC', { ipProtocol: IpProtocol.DUAL_STACK, subnetConfiguration: [ { subnetType: testData.subnetType, name: 'subnetName', ipv6AssignAddressOnCreation: true, }, ], }); ``` ### error ```sh 6:39:48 PM | CREATE_FAILED | AWS::EC2::Subnet | vpcisolatedSubnet1Subnet06BBE51F Template error: Fn::Select cannot select nonexistent value at index 0 ``` ### solution A dependency on the CidrBlock has been added [as discussed in issue](#28843 (comment)). ```ts (this.isolatedSubnets as PrivateSubnet[]).forEach((isolatedSubnet) => { if (this.ipv6CidrBlock !== undefined) { isolatedSubnet.node.addDependency(this.ipv6CidrBlock); } }); ``` ## Question This modification results in the failure of existing integration tests. I don't consider this change to be a breaking one, so I went ahead and updated the snapshot. Is that okay? ```sh CHANGED aws-ec2/test/integ.vpc-dual-stack-ec2 0.776s Resources [~] AWS::EC2::Subnet Ip6VpcDualStackPrivateSubnet1Subnet842B7F4C └─ [+] DependsOn └─ ["Ip6VpcDualStackipv6cidr40BE830A"] [~] AWS::EC2::RouteTable Ip6VpcDualStackPrivateSubnet1RouteTable5326D239 └─ [+] DependsOn └─ ["Ip6VpcDualStackipv6cidr40BE830A"] [~] AWS::EC2::SubnetRouteTableAssociation Ip6VpcDualStackPrivateSubnet1RouteTableAssociationF1C10B6A └─ [+] DependsOn └─ ["Ip6VpcDualStackipv6cidr40BE830A"] [~] AWS::EC2::Subnet Ip6VpcDualStackPrivateSubnet2SubnetEB493489 └─ [+] DependsOn └─ ["Ip6VpcDualStackipv6cidr40BE830A"] [~] AWS::EC2::RouteTable Ip6VpcDualStackPrivateSubnet2RouteTable56BF517C └─ [+] DependsOn └─ ["Ip6VpcDualStackipv6cidr40BE830A"] [~] AWS::EC2::SubnetRouteTableAssociation Ip6VpcDualStackPrivateSubnet2RouteTableAssociationD37A3D3D └─ [+] DependsOn └─ ["Ip6VpcDualStackipv6cidr40BE830A"] ``` Closes #28843 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 8c79bdc commit 9de77bb

File tree

20 files changed

+8039
-6292
lines changed

20 files changed

+8039
-6292
lines changed
Lines changed: 5011 additions & 6127 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-dual-stack-ec2.js.snapshot/manifest.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)