Skip to content

Commit 3c0e46b

Browse files
committed
feat(ec2): support for Cloud Wan Core Network routes
1 parent 57ae6f9 commit 3c0e46b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,6 +2372,11 @@ export enum RouterType {
23722372
* VPC Endpoint for gateway load balancers
23732373
*/
23742374
VPC_ENDPOINT = 'VpcEndpoint',
2375+
2376+
/**
2377+
* AWS Network Manager Core Network
2378+
*/
2379+
CORE_NETWORK = 'CoreNetwork',
23752380
}
23762381

23772382
function routerTypeToPropName(routerType: RouterType) {
@@ -2386,6 +2391,7 @@ function routerTypeToPropName(routerType: RouterType) {
23862391
[RouterType.TRANSIT_GATEWAY]: 'transitGatewayId',
23872392
[RouterType.VPC_PEERING_CONNECTION]: 'vpcPeeringConnectionId',
23882393
[RouterType.VPC_ENDPOINT]: 'vpcEndpointId',
2394+
[RouterType.CORE_NETWORK]: 'coreNetworkArn',
23892395
})[routerType];
23902396
}
23912397

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)