Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ec2): deploying an isolated subnet fails when `ipv6AssignAddressO…
…nCreation` 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*
- Loading branch information