You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ec2-alpha): addInternetGW handles shared route table for subnets (#33824)
### Issue # (if applicable)
Closes#33672
### Reason for this change
Earlier same routes were being added to shared route table between subnets causing deployment failures.
### Description of changes
- Added helper method to unique we don't process single route table twice.
- Also added return value for IGW and EIGW so that customers can refer them to as target later, similar to other gateway and endpoints.
### Describe any new or updated permissions being added
NA
### Description of how you validated changes
Added unit test and integration test
Limitation for adding integration test for IPv6, we don't know the `AmazonprovidedIPv6` before for which local route gets added and needs to be added in expected assertion.
```
Error: Resolution error: Resolution error: Resolution error: Found an encoded list token string in a scalar string context. Use 'Fn.select(0, list)' (not 'list[0]') to extract elements from token lists.
{
DestinationCidrBlock: vpc.ipv6CidrBlocks[0],
GatewayId: 'local',
},
```
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
* Helper function to process unique subnets and route table for adding routes
535
+
*/
536
+
privateprocessSubnets(
537
+
subnets: ISubnetV2[],
538
+
routeHandler: (subnet: ISubnetV2)=>void,
539
+
): void{
540
+
constprocessedSubnets=newSet<string>();
541
+
constprocessedRouteTables=newSet<string>();
542
+
subnets.forEach((subnet)=>{
543
+
if(!this.publicSubnets.includes(subnet)){
544
+
Annotations.of(this).addWarningV2('InternetGatewayWarning',`Given ${subnet.node.id} is not a public subnet. Internet Gateway should be added only to public subnets.`);
Copy file name to clipboardExpand all lines: packages/@aws-cdk/aws-ec2-alpha/test/integ.vpc-shared-route-table.js.snapshot/VpcSharedRouteTableIntegDefaultTestDeployAssert4BB1B1C8.assets.json
0 commit comments