Skip to content

Commit fba027b

Browse files
authored
feat(ec2): support for Cloud Wan Core Network routes (#35008)
### Reason for this change Routing through Cloud WAN Core Network ### Description of changes Added Core Network to RouterType enum, updated typeToParameter function, updated tests. ### Describe any new or updated permissions being added None ### Description of how you validated changes Updated and ran the tests. C ### 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*
1 parent 67ef21f commit fba027b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

packages/@aws-cdk/aws-ec2-alpha/lib/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,5 +879,6 @@ function routerTypeToPropName(routerType: RouterType) {
879879
[RouterType.TRANSIT_GATEWAY]: 'transitGatewayId',
880880
[RouterType.VPC_PEERING_CONNECTION]: 'vpcPeeringConnectionId',
881881
[RouterType.VPC_ENDPOINT]: 'vpcEndpointId',
882+
[RouterType.CORE_NETWORK]: 'coreNetworkArn',
882883
})[routerType];
883884
}

packages/aws-cdk-lib/aws-ec2/lib/vpc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,6 +2426,11 @@ export enum RouterType {
24262426
* VPC Endpoint for gateway load balancers
24272427
*/
24282428
VPC_ENDPOINT = 'VpcEndpoint',
2429+
2430+
/**
2431+
* AWS Network Manager Core Network
2432+
*/
2433+
CORE_NETWORK = 'CoreNetwork',
24292434
}
24302435

24312436
function routerTypeToPropName(routerType: RouterType) {
@@ -2440,6 +2445,7 @@ function routerTypeToPropName(routerType: RouterType) {
24402445
[RouterType.TRANSIT_GATEWAY]: 'transitGatewayId',
24412446
[RouterType.VPC_PEERING_CONNECTION]: 'vpcPeeringConnectionId',
24422447
[RouterType.VPC_ENDPOINT]: 'vpcEndpointId',
2448+
[RouterType.CORE_NETWORK]: 'coreNetworkArn',
24432449
})[routerType];
24442450
}
24452451

packages/aws-cdk-lib/aws-ec2/test/vpc.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,6 +2623,10 @@ describe('vpc', () => {
26232623
routerType: RouterType.VPC_ENDPOINT,
26242624
routerId: 'vpc-endpoint-id',
26252625
});
2626+
(vpc.publicSubnets[0] as Subnet).addRoute('CoreNetworkRoute', {
2627+
routerType: RouterType.CORE_NETWORK,
2628+
routerId: 'core-network-arn',
2629+
});
26262630

26272631
// THEN
26282632
Template.fromStack(stack).hasResourceProperties('AWS::EC2::Route', {
@@ -2637,6 +2641,9 @@ describe('vpc', () => {
26372641
Template.fromStack(stack).hasResourceProperties('AWS::EC2::Route', {
26382642
VpcEndpointId: 'vpc-endpoint-id',
26392643
});
2644+
Template.fromStack(stack).hasResourceProperties('AWS::EC2::Route', {
2645+
CoreNetworkArn: 'core-network-arn',
2646+
});
26402647
});
26412648
});
26422649

0 commit comments

Comments
 (0)