From 9f601032d954b920600e9bf140d73a02a73968cf Mon Sep 17 00:00:00 2001 From: Kailey Chen Date: Thu, 3 Oct 2024 15:24:34 -0700 Subject: [PATCH] add integration test --- .../aws-cdk-routev2-alpha.assets.json | 2 +- ...routev2-dynamodbendpoint-alpha.assets.json | 2 +- ...dk-routev2-egressonlyigw-alpha.assets.json | 6 +- ...-routev2-egressonlyigw-alpha.template.json | 6 +- .../aws-cdk-routev2-igw-alpha.assets.json | 6 +- .../aws-cdk-routev2-igw-alpha.template.json | 40 +- ...ws-cdk-routev2-networkif-alpha.assets.json | 2 +- ...cdk-routev2-privatenatgw-alpha.assets.json | 6 +- ...k-routev2-privatenatgw-alpha.template.json | 5 +- ...-cdk-routev2-publicnatgw-alpha.assets.json | 6 +- ...dk-routev2-publicnatgw-alpha.template.json | 46 +- ...routev2-virtualprivategw-alpha.assets.json | 6 +- ...utev2-virtualprivategw-alpha.template.json | 56 ++- ...outev2-vpcpeerconnection-alpha.assets.json | 6 +- ...tev2-vpcpeerconnection-alpha.template.json | 191 +++++-- .../test/integ.route-v2.js.snapshot/cdk.out | 2 +- .../integ.route-v2.js.snapshot/integ.json | 2 +- ...efaultTestDeployAssertA16689B0.assets.json | 2 +- ...efaultTestDeployAssert46FEDE40.assets.json | 2 +- ...efaultTestDeployAssert04E3783E.assets.json | 2 +- ...efaultTestDeployAssertF3FA2F74.assets.json | 2 +- ...efaultTestDeployAssert4B12233C.assets.json | 2 +- ...efaultTestDeployAssertC0DDB875.assets.json | 2 +- ...efaultTestDeployAssert90B004F4.assets.json | 2 +- ...efaultTestDeployAssert4C509DCE.assets.json | 2 +- ...efaultTestDeployAssert77221752.assets.json | 2 +- .../integ.route-v2.js.snapshot/manifest.json | 112 +++-- .../test/integ.route-v2.js.snapshot/tree.json | 471 +++++++++++++----- .../aws-ec2-alpha/test/integ.route-v2.ts | 18 +- 29 files changed, 736 insertions(+), 273 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-alpha.assets.json index 953b3a4ae82e9..3aacec615df4b 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-alpha.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "a963276e8401c096a74f0dc50ac7d80bb5f2bff399fce8c571660a0684ff54b7": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-dynamodbendpoint-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-dynamodbendpoint-alpha.assets.json index 6f27e2c04e801..9f1bcf2f7d571 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-dynamodbendpoint-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-dynamodbendpoint-alpha.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "8b4b159425cc7d11fa6fd993c53e299319dd2fcea18d745e873a18d3ee156a50": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.assets.json index d17484319eef3..c1c2915c2db8f 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { - "b0e303439a83ae17adf592a6599e13f880529abf2f46f433af0742284a224385": { + "59eea98c04eb81e61ad96cf12d5ad30981ba8827c0a6f9329042aaf3b6ab25ae": { "source": { "path": "aws-cdk-routev2-egressonlyigw-alpha.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b0e303439a83ae17adf592a6599e13f880529abf2f46f433af0742284a224385.json", + "objectKey": "59eea98c04eb81e61ad96cf12d5ad30981ba8827c0a6f9329042aaf3b6ab25ae.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.template.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.template.json index cd3a0c0a42484..fcebef0b91123 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.template.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-egressonlyigw-alpha.template.json @@ -35,7 +35,6 @@ "TestRoottableeigwRouteF867084E": { "Type": "AWS::EC2::Route", "Properties": { - "DestinationCidrBlock": "::/0", "DestinationIpv6CidrBlock": "::/0", "EgressOnlyInternetGatewayId": { "Fn::GetAtt": [ @@ -49,7 +48,10 @@ "RouteTableId" ] } - } + }, + "DependsOn": [ + "testEOIGWEIGW54CCAD37" + ] }, "eigwSubnetCC28B9F9": { "Type": "AWS::EC2::Subnet", diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.assets.json index a62abd102c23c..a48f00526bfc3 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { - "62f0873928dbdff7cc7c914e7275014da0d4f8e188fb633ea74a8cae7129ea0b": { + "26ace3dfd222102fc0437541ab4b4c0eb03fcd95da132842d7546d8bb568cdd5": { "source": { "path": "aws-cdk-routev2-igw-alpha.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "62f0873928dbdff7cc7c914e7275014da0d4f8e188fb633ea74a8cae7129ea0b.json", + "objectKey": "26ace3dfd222102fc0437541ab4b4c0eb03fcd95da132842d7546d8bb568cdd5.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.template.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.template.json index 1e21b3bc2c96f..392a6e1e2e395 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.template.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-igw-alpha.template.json @@ -48,24 +48,11 @@ "RouteTableId" ] } - } - }, - "TestRoottableigwRouteGWAttachment4B3E8FD9": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "InternetGatewayId": { - "Fn::GetAtt": [ - "testIGW8D947AF2", - "InternetGatewayId" - ] - }, - "VpcId": { - "Fn::GetAtt": [ - "igw127F1970", - "VpcId" - ] - } - } + }, + "DependsOn": [ + "testIGWGWAttachment682A6782", + "testIGW8D947AF2" + ] }, "igwSubnetF238E402": { "Type": "AWS::EC2::Subnet", @@ -114,6 +101,23 @@ }, "testIGW8D947AF2": { "Type": "AWS::EC2::InternetGateway" + }, + "testIGWGWAttachment682A6782": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Fn::GetAtt": [ + "testIGW8D947AF2", + "InternetGatewayId" + ] + }, + "VpcId": { + "Fn::GetAtt": [ + "igw127F1970", + "VpcId" + ] + } + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-networkif-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-networkif-alpha.assets.json index 805e32a041de3..361119ec14756 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-networkif-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-networkif-alpha.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "434c826abb6c12fb9eebf4adb6aae43788ba6e2a204ad7eea6f60321e69d3b38": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.assets.json index 6fae013fe0a29..22f5a39f5640f 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { - "a4d43e15d95d55923771937ed74a05c6bd09a65f55f0c99a5ba9ca05069d7cbd": { + "39e23e50b17229259428c78d506b45da6f2681804d01ba216b26facaf35f69d6": { "source": { "path": "aws-cdk-routev2-privatenatgw-alpha.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a4d43e15d95d55923771937ed74a05c6bd09a65f55f0c99a5ba9ca05069d7cbd.json", + "objectKey": "39e23e50b17229259428c78d506b45da6f2681804d01ba216b26facaf35f69d6.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.template.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.template.json index 654e1e1de840e..98023baef1952 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.template.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-privatenatgw-alpha.template.json @@ -48,7 +48,10 @@ "RouteTableId" ] } - } + }, + "DependsOn": [ + "testNATgwNATGateway1533420D" + ] }, "natgwprivSubnetE547C5A0": { "Type": "AWS::EC2::Subnet", diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.assets.json index f59abe7b20923..0a7794b4fb281 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { - "85cd968be34ab2030a45e0e808082aa88035954029c2b379b38368ed20327047": { + "895d9a465fd31edd1eaadb22929fc8cf042ad912d272ea411632a6c9f820aba9": { "source": { "path": "aws-cdk-routev2-publicnatgw-alpha.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "85cd968be34ab2030a45e0e808082aa88035954029c2b379b38368ed20327047.json", + "objectKey": "895d9a465fd31edd1eaadb22929fc8cf042ad912d272ea411632a6c9f820aba9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.template.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.template.json index 81030e32ede4d..2ae7eceb04166 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.template.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-publicnatgw-alpha.template.json @@ -48,24 +48,11 @@ "RouteTableId" ] } - } - }, - "TestRoottablenatGwRouteGWAttachment1D9CDF77": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "InternetGatewayId": { - "Fn::GetAtt": [ - "testNATgwIGW6AC97E9A", - "InternetGatewayId" - ] - }, - "VpcId": { - "Fn::GetAtt": [ - "natgwpub2FB85986", - "VpcId" - ] - } - } + }, + "DependsOn": [ + "testNATgwIGWGWAttachment63DC9091", + "testNATgwIGW6AC97E9A" + ] }, "TestRoottablenatGwPubRoute0463E2F5": { "Type": "AWS::EC2::Route", @@ -83,7 +70,11 @@ "RouteTableId" ] } - } + }, + "DependsOn": [ + "testNATgwEIP1C260FAD", + "testNATgwNATGateway1533420D" + ] }, "natgwpubSubnet79D316E5": { "Type": "AWS::EC2::Subnet", @@ -133,6 +124,23 @@ "testNATgwIGW6AC97E9A": { "Type": "AWS::EC2::InternetGateway" }, + "testNATgwIGWGWAttachment63DC9091": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Fn::GetAtt": [ + "testNATgwIGW6AC97E9A", + "InternetGatewayId" + ] + }, + "VpcId": { + "Fn::GetAtt": [ + "natgwpub2FB85986", + "VpcId" + ] + } + } + }, "testNATgwEIP1C260FAD": { "Type": "AWS::EC2::EIP", "Properties": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.assets.json index 0cd2e52e78a44..345f3924a3e83 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { - "fa2b156112be3f11361259d8aaafcd552d28499bba4cc881642fdc98bc04c924": { + "6d2e4cfbc5e7bfd23a115ae098e231aa3f8f68fc66cf9834642b374c23457ca7": { "source": { "path": "aws-cdk-routev2-virtualprivategw-alpha.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "fa2b156112be3f11361259d8aaafcd552d28499bba4cc881642fdc98bc04c924.json", + "objectKey": "6d2e4cfbc5e7bfd23a115ae098e231aa3f8f68fc66cf9834642b374c23457ca7.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.template.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.template.json index b25f6ff502905..00b2d94c9e5c7 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.template.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-virtualprivategw-alpha.template.json @@ -48,24 +48,12 @@ "RouteTableId" ] } - } - }, - "TestRoottablevpgwRouteGWAttachmentDD0077EE": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Fn::GetAtt": [ - "vpgw2AB64B6B", - "VpcId" - ] - }, - "VpnGatewayId": { - "Fn::GetAtt": [ - "testVPGWIGW816C7C4F", - "VPNGatewayId" - ] - } - } + }, + "DependsOn": [ + "testVPGWIGW816C7C4F", + "testVPGWRoutePropagationD01C7942", + "testVPGWVPCVPNGWF1D3DC88" + ] }, "vpgwSubnet5E7F36AD": { "Type": "AWS::EC2::Subnet", @@ -117,6 +105,38 @@ "Properties": { "Type": "ipsec.1" } + }, + "testVPGWVPCVPNGWF1D3DC88": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Fn::GetAtt": [ + "vpgw2AB64B6B", + "VpcId" + ] + }, + "VpnGatewayId": { + "Fn::GetAtt": [ + "testVPGWIGW816C7C4F", + "VPNGatewayId" + ] + } + } + }, + "testVPGWRoutePropagationD01C7942": { + "Type": "AWS::EC2::VPNGatewayRoutePropagation", + "Properties": { + "RouteTableIds": [], + "VpnGatewayId": { + "Fn::GetAtt": [ + "testVPGWIGW816C7C4F", + "VPNGatewayId" + ] + } + }, + "DependsOn": [ + "testVPGWVPCVPNGWF1D3DC88" + ] } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.assets.json index 94cc48acf6542..47f4987a1309b 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { - "fa56ca630709a15070b4208becd94454c974906d445fd83b73389524957f89e8": { + "4fc8e38f9f8c75b7937e32a2d8924346cf1648878ab74ccf8083f3c7958cf89a": { "source": { "path": "aws-cdk-routev2-vpcpeerconnection-alpha.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "fa56ca630709a15070b4208becd94454c974906d445fd83b73389524957f89e8.json", + "objectKey": "4fc8e38f9f8c75b7937e32a2d8924346cf1648878ab74ccf8083f3c7958cf89a.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.template.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.template.json index 7f195e58f758f..13d920985631c 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.template.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/aws-cdk-routev2-vpcpeerconnection-alpha.template.json @@ -32,50 +32,183 @@ } } }, - "vpcpcSubnet1DD6CE35": { - "Type": "AWS::EC2::Subnet", + "TestRoottablevpcPeeringRouteA5DE3C21": { + "Type": "AWS::EC2::Route", "Properties": { - "AssignIpv6AddressOnCreation": false, - "AvailabilityZone": "us-east-1a", - "CidrBlock": "10.0.0.0/24", - "Ipv6CidrBlock": { - "Fn::Select": [ - 0, - { - "Fn::GetAtt": [ - "vpcpc6CAE1A04", - "Ipv6CidrBlocks" - ] - } + "DestinationCidrBlock": "0.0.0.0/0", + "RouteTableId": { + "Fn::GetAtt": [ + "TestRoottableRouteTableFA28AA38", + "RouteTableId" ] }, - "VpcId": { + "VpcPeeringConnectionId": { "Fn::GetAtt": [ - "vpcpc6CAE1A04", - "VpcId" + "crossAccountCrossRegionPeeringPeeringConnection1503A608", + "Id" ] } }, "DependsOn": [ - "vpcpcAmazonIpv66504EEB2" + "crossAccountCrossRegionPeeringPeeringConnection1503A608", + "crossAccountCrossRegionPeeringPeerRoleDefaultPolicy4F428B82", + "crossAccountCrossRegionPeeringPeerRoleA26F8D4F" ] }, - "vpcpcSubnetRouteTableAssociation8531BF5C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", + "secondVPCFBB45262": { + "Type": "AWS::EC2::VPC", "Properties": { - "RouteTableId": { + "CidrBlock": "10.1.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default" + } + }, + "secondVPCTempBlock7F6107B6": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "CidrBlock": "10.2.0.0/16", + "VpcId": { "Fn::GetAtt": [ - "TestRoottableRouteTableFA28AA38", - "RouteTableId" + "secondVPCFBB45262", + "VpcId" + ] + } + } + }, + "crossAccountCrossRegionPeeringPeerRoleA26F8D4F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + }, + "RoleName": "VPCPeeringRole-crossAccountCrossRegionPeering" + } + }, + "crossAccountCrossRegionPeeringPeerRoleDefaultPolicy4F428B82": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ec2:acceptVpcPeeringConnection", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:us-west-2:123456789012:vpc/", + { + "Fn::GetAtt": [ + "secondVPCFBB45262", + "VpcId" + ] + } + ] + ] + } + }, + { + "Action": "ec2:acceptVpcPeeringConnection", + "Condition": { + "StringEquals": { + "ec2:AccepterVpc": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:us-west-2:123456789012:vpc/", + { + "Fn::GetAtt": [ + "secondVPCFBB45262", + "VpcId" + ] + } + ] + ] + } + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:us-west-2:123456789012:vpc-peering-connection/*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "crossAccountCrossRegionPeeringPeerRoleDefaultPolicy4F428B82", + "Roles": [ + { + "Ref": "crossAccountCrossRegionPeeringPeerRoleA26F8D4F" + } + ] + } + }, + "crossAccountCrossRegionPeeringPeeringConnection1503A608": { + "Type": "AWS::EC2::VPCPeeringConnection", + "Properties": { + "PeerOwnerId": "123456789012", + "PeerRegion": "us-west-2", + "PeerRoleArn": { + "Fn::GetAtt": [ + "crossAccountCrossRegionPeeringPeerRoleA26F8D4F", + "Arn" + ] + }, + "PeerVpcId": { + "Fn::GetAtt": [ + "secondVPCFBB45262", + "VpcId" ] }, - "SubnetId": { - "Ref": "vpcpcSubnet1DD6CE35" + "VpcId": { + "Fn::GetAtt": [ + "vpcpc6CAE1A04", + "VpcId" + ] } - }, - "DependsOn": [ - "vpcpcAmazonIpv66504EEB2" - ] + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/cdk.out b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/cdk.out index bd5311dc372de..c6e612584e352 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.5"} \ No newline at end of file +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integ.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integ.json index 488691ab97ceb..1454dfacdafeb 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "testCases": { "integtest-model-8/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel0DefaultTestDeployAssertA16689B0.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel0DefaultTestDeployAssertA16689B0.assets.json index 6f5363d26cf89..a11f7522ff2c1 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel0DefaultTestDeployAssertA16689B0.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel0DefaultTestDeployAssertA16689B0.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel1DefaultTestDeployAssert46FEDE40.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel1DefaultTestDeployAssert46FEDE40.assets.json index 9094ce35beea5..26d3a67e90f8e 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel1DefaultTestDeployAssert46FEDE40.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel1DefaultTestDeployAssert46FEDE40.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel2DefaultTestDeployAssert04E3783E.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel2DefaultTestDeployAssert04E3783E.assets.json index 29387894579ea..879ae61de4a92 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel2DefaultTestDeployAssert04E3783E.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel2DefaultTestDeployAssert04E3783E.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel3DefaultTestDeployAssertF3FA2F74.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel3DefaultTestDeployAssertF3FA2F74.assets.json index 6afa1f9195a7b..8c85a8079f81a 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel3DefaultTestDeployAssertF3FA2F74.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel3DefaultTestDeployAssertF3FA2F74.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel4DefaultTestDeployAssert4B12233C.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel4DefaultTestDeployAssert4B12233C.assets.json index 2170d2cd526f2..3be51680402a3 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel4DefaultTestDeployAssert4B12233C.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel4DefaultTestDeployAssert4B12233C.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel5DefaultTestDeployAssertC0DDB875.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel5DefaultTestDeployAssertC0DDB875.assets.json index aed458dfb9b1f..0ea575ebff5fb 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel5DefaultTestDeployAssertC0DDB875.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel5DefaultTestDeployAssertC0DDB875.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel6DefaultTestDeployAssert90B004F4.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel6DefaultTestDeployAssert90B004F4.assets.json index 29423943325fc..a0150ed0c4e0c 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel6DefaultTestDeployAssert90B004F4.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel6DefaultTestDeployAssert90B004F4.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel7DefaultTestDeployAssert4C509DCE.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel7DefaultTestDeployAssert4C509DCE.assets.json index 6fe2b5a955f17..f38ecf622deca 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel7DefaultTestDeployAssert4C509DCE.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel7DefaultTestDeployAssert4C509DCE.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel8DefaultTestDeployAssert77221752.assets.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel8DefaultTestDeployAssert77221752.assets.json index d9fd3cff95553..70e2f461020b3 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel8DefaultTestDeployAssert77221752.assets.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/integtestmodel8DefaultTestDeployAssert77221752.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/manifest.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/manifest.json index 2e922475b66bf..6a6473586d703 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "artifacts": { "aws-cdk-routev2-alpha.assets": { "type": "cdk:asset-manifest", @@ -16,6 +16,7 @@ "templateFile": "aws-cdk-routev2-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a963276e8401c096a74f0dc50ac7d80bb5f2bff399fce8c571660a0684ff54b7.json", @@ -95,9 +96,10 @@ "templateFile": "aws-cdk-routev2-egressonlyigw-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b0e303439a83ae17adf592a6599e13f880529abf2f46f433af0742284a224385.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/59eea98c04eb81e61ad96cf12d5ad30981ba8827c0a6f9329042aaf3b6ab25ae.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -186,9 +188,10 @@ "templateFile": "aws-cdk-routev2-igw-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/62f0873928dbdff7cc7c914e7275014da0d4f8e188fb633ea74a8cae7129ea0b.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/26ace3dfd222102fc0437541ab4b4c0eb03fcd95da132842d7546d8bb568cdd5.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -229,12 +232,6 @@ "data": "TestRoottableigwRouteC52EF731" } ], - "/aws-cdk-routev2-igw-alpha/TestRoottable/igwRoute/GWAttachment": [ - { - "type": "aws:cdk:logicalId", - "data": "TestRoottableigwRouteGWAttachment4B3E8FD9" - } - ], "/aws-cdk-routev2-igw-alpha/igwSubnet/Subnet": [ { "type": "aws:cdk:logicalId", @@ -253,6 +250,12 @@ "data": "testIGW8D947AF2" } ], + "/aws-cdk-routev2-igw-alpha/testIGW/GWAttachment": [ + { + "type": "aws:cdk:logicalId", + "data": "testIGWGWAttachment682A6782" + } + ], "/aws-cdk-routev2-igw-alpha/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -283,9 +286,10 @@ "templateFile": "aws-cdk-routev2-virtualprivategw-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fa2b156112be3f11361259d8aaafcd552d28499bba4cc881642fdc98bc04c924.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6d2e4cfbc5e7bfd23a115ae098e231aa3f8f68fc66cf9834642b374c23457ca7.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -326,12 +330,6 @@ "data": "TestRoottablevpgwRouteAD510A2A" } ], - "/aws-cdk-routev2-virtualprivategw-alpha/TestRoottable/vpgwRoute/GWAttachment": [ - { - "type": "aws:cdk:logicalId", - "data": "TestRoottablevpgwRouteGWAttachmentDD0077EE" - } - ], "/aws-cdk-routev2-virtualprivategw-alpha/vpgwSubnet/Subnet": [ { "type": "aws:cdk:logicalId", @@ -344,12 +342,30 @@ "data": "vpgwSubnetRouteTableAssociation49921F90" } ], + "/aws-cdk-routev2-virtualprivategw-alpha/testVPGW": [ + { + "type": "aws:cdk:warning", + "data": "No subnets matching selection: '[]'. Select other subnets to add routes to. [ack: @aws-cdk:aws-ec2-elpha:enableVpnGatewayV2]" + } + ], "/aws-cdk-routev2-virtualprivategw-alpha/testVPGW/IGW": [ { "type": "aws:cdk:logicalId", "data": "testVPGWIGW816C7C4F" } ], + "/aws-cdk-routev2-virtualprivategw-alpha/testVPGW/VPCVPNGW": [ + { + "type": "aws:cdk:logicalId", + "data": "testVPGWVPCVPNGWF1D3DC88" + } + ], + "/aws-cdk-routev2-virtualprivategw-alpha/testVPGW/RoutePropagation": [ + { + "type": "aws:cdk:logicalId", + "data": "testVPGWRoutePropagationD01C7942" + } + ], "/aws-cdk-routev2-virtualprivategw-alpha/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -380,9 +396,10 @@ "templateFile": "aws-cdk-routev2-publicnatgw-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/85cd968be34ab2030a45e0e808082aa88035954029c2b379b38368ed20327047.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/895d9a465fd31edd1eaadb22929fc8cf042ad912d272ea411632a6c9f820aba9.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -423,12 +440,6 @@ "data": "TestRoottablenatGwRoute31868FBF" } ], - "/aws-cdk-routev2-publicnatgw-alpha/TestRoottable/natGwRoute/GWAttachment": [ - { - "type": "aws:cdk:logicalId", - "data": "TestRoottablenatGwRouteGWAttachment1D9CDF77" - } - ], "/aws-cdk-routev2-publicnatgw-alpha/TestRoottable/natGwPubRoute/Route": [ { "type": "aws:cdk:logicalId", @@ -453,6 +464,12 @@ "data": "testNATgwIGW6AC97E9A" } ], + "/aws-cdk-routev2-publicnatgw-alpha/testNATgwIGW/GWAttachment": [ + { + "type": "aws:cdk:logicalId", + "data": "testNATgwIGWGWAttachment63DC9091" + } + ], "/aws-cdk-routev2-publicnatgw-alpha/testNATgw/EIP": [ { "type": "aws:cdk:logicalId", @@ -495,9 +512,10 @@ "templateFile": "aws-cdk-routev2-privatenatgw-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a4d43e15d95d55923771937ed74a05c6bd09a65f55f0c99a5ba9ca05069d7cbd.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/39e23e50b17229259428c78d506b45da6f2681804d01ba216b26facaf35f69d6.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -586,6 +604,7 @@ "templateFile": "aws-cdk-routev2-networkif-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/434c826abb6c12fb9eebf4adb6aae43788ba6e2a204ad7eea6f60321e69d3b38.json", @@ -665,9 +684,10 @@ "templateFile": "aws-cdk-routev2-vpcpeerconnection-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fa56ca630709a15070b4208becd94454c974906d445fd83b73389524957f89e8.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4fc8e38f9f8c75b7937e32a2d8924346cf1648878ab74ccf8083f3c7958cf89a.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -702,16 +722,40 @@ "data": "TestRoottableRouteTableFA28AA38" } ], - "/aws-cdk-routev2-vpcpeerconnection-alpha/vpcpcSubnet/Subnet": [ + "/aws-cdk-routev2-vpcpeerconnection-alpha/TestRoottable/vpcPeeringRoute/Route": [ + { + "type": "aws:cdk:logicalId", + "data": "TestRoottablevpcPeeringRouteA5DE3C21" + } + ], + "/aws-cdk-routev2-vpcpeerconnection-alpha/secondVPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "secondVPCFBB45262" + } + ], + "/aws-cdk-routev2-vpcpeerconnection-alpha/secondVPC/Temp Block": [ + { + "type": "aws:cdk:logicalId", + "data": "secondVPCTempBlock7F6107B6" + } + ], + "/aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeerRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "crossAccountCrossRegionPeeringPeerRoleA26F8D4F" + } + ], + "/aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeerRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "vpcpcSubnet1DD6CE35" + "data": "crossAccountCrossRegionPeeringPeerRoleDefaultPolicy4F428B82" } ], - "/aws-cdk-routev2-vpcpeerconnection-alpha/vpcpcSubnet/RouteTableAssociation": [ + "/aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeeringConnection": [ { "type": "aws:cdk:logicalId", - "data": "vpcpcSubnetRouteTableAssociation8531BF5C" + "data": "crossAccountCrossRegionPeeringPeeringConnection1503A608" } ], "/aws-cdk-routev2-vpcpeerconnection-alpha/BootstrapVersion": [ @@ -744,6 +788,7 @@ "templateFile": "aws-cdk-routev2-dynamodbendpoint-alpha.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8b4b159425cc7d11fa6fd993c53e299319dd2fcea18d745e873a18d3ee156a50.json", @@ -829,6 +874,7 @@ "templateFile": "integtestmodel0DefaultTestDeployAssertA16689B0.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -877,6 +923,7 @@ "templateFile": "integtestmodel1DefaultTestDeployAssert46FEDE40.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -925,6 +972,7 @@ "templateFile": "integtestmodel2DefaultTestDeployAssert04E3783E.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -973,6 +1021,7 @@ "templateFile": "integtestmodel3DefaultTestDeployAssertF3FA2F74.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -1021,6 +1070,7 @@ "templateFile": "integtestmodel4DefaultTestDeployAssert4B12233C.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -1069,6 +1119,7 @@ "templateFile": "integtestmodel5DefaultTestDeployAssertC0DDB875.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -1117,6 +1168,7 @@ "templateFile": "integtestmodel6DefaultTestDeployAssert90B004F4.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -1165,6 +1217,7 @@ "templateFile": "integtestmodel7DefaultTestDeployAssert4C509DCE.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", @@ -1213,6 +1266,7 @@ "templateFile": "integtestmodel8DefaultTestDeployAssert77221752.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/tree.json b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/tree.json index 68cca1ffdc6ab..64125ce6f223f 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.js.snapshot/tree.json @@ -263,7 +263,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "::/0", "destinationIpv6CidrBlock": "::/0", "egressOnlyInternetGatewayId": { "Fn::GetAtt": [ @@ -286,7 +285,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-ec2-alpha.Route", "version": "0.0.0" } } @@ -512,35 +511,10 @@ "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", "version": "0.0.0" } - }, - "GWAttachment": { - "id": "GWAttachment", - "path": "aws-cdk-routev2-igw-alpha/TestRoottable/igwRoute/GWAttachment", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "internetGatewayId": { - "Fn::GetAtt": [ - "testIGW8D947AF2", - "InternetGatewayId" - ] - }, - "vpcId": { - "Fn::GetAtt": [ - "igw127F1970", - "VpcId" - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-ec2-alpha.Route", "version": "0.0.0" } } @@ -638,6 +612,31 @@ "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", "version": "0.0.0" } + }, + "GWAttachment": { + "id": "GWAttachment", + "path": "aws-cdk-routev2-igw-alpha/testIGW/GWAttachment", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Fn::GetAtt": [ + "testIGW8D947AF2", + "InternetGatewayId" + ] + }, + "vpcId": { + "Fn::GetAtt": [ + "igw127F1970", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } } }, "constructInfo": { @@ -770,35 +769,10 @@ "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", "version": "0.0.0" } - }, - "GWAttachment": { - "id": "GWAttachment", - "path": "aws-cdk-routev2-virtualprivategw-alpha/TestRoottable/vpgwRoute/GWAttachment", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Fn::GetAtt": [ - "vpgw2AB64B6B", - "VpcId" - ] - }, - "vpnGatewayId": { - "Fn::GetAtt": [ - "testVPGWIGW816C7C4F", - "VPNGatewayId" - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-ec2-alpha.Route", "version": "0.0.0" } } @@ -898,10 +872,55 @@ "fqn": "aws-cdk-lib.aws_ec2.CfnVPNGateway", "version": "0.0.0" } + }, + "VPCVPNGW": { + "id": "VPCVPNGW", + "path": "aws-cdk-routev2-virtualprivategw-alpha/testVPGW/VPCVPNGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Fn::GetAtt": [ + "vpgw2AB64B6B", + "VpcId" + ] + }, + "vpnGatewayId": { + "Fn::GetAtt": [ + "testVPGWIGW816C7C4F", + "VPNGatewayId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + }, + "RoutePropagation": { + "id": "RoutePropagation", + "path": "aws-cdk-routev2-virtualprivategw-alpha/testVPGW/RoutePropagation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPNGatewayRoutePropagation", + "aws:cdk:cloudformation:props": { + "routeTableIds": [], + "vpnGatewayId": { + "Fn::GetAtt": [ + "testVPGWIGW816C7C4F", + "VPNGatewayId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPNGatewayRoutePropagation", + "version": "0.0.0" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2-alpha.VPNGateway", + "fqn": "@aws-cdk/aws-ec2-alpha.VPNGatewayV2", "version": "0.0.0" } }, @@ -1030,35 +1049,10 @@ "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", "version": "0.0.0" } - }, - "GWAttachment": { - "id": "GWAttachment", - "path": "aws-cdk-routev2-publicnatgw-alpha/TestRoottable/natGwRoute/GWAttachment", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "internetGatewayId": { - "Fn::GetAtt": [ - "testNATgwIGW6AC97E9A", - "InternetGatewayId" - ] - }, - "vpcId": { - "Fn::GetAtt": [ - "natgwpub2FB85986", - "VpcId" - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-ec2-alpha.Route", "version": "0.0.0" } }, @@ -1094,7 +1088,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-ec2-alpha.Route", "version": "0.0.0" } } @@ -1192,6 +1186,31 @@ "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", "version": "0.0.0" } + }, + "GWAttachment": { + "id": "GWAttachment", + "path": "aws-cdk-routev2-publicnatgw-alpha/testNATgwIGW/GWAttachment", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Fn::GetAtt": [ + "testNATgwIGW6AC97E9A", + "InternetGatewayId" + ] + }, + "vpcId": { + "Fn::GetAtt": [ + "natgwpub2FB85986", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } } }, "constructInfo": { @@ -1378,7 +1397,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-ec2-alpha.Route", "version": "0.0.0" } } @@ -1764,6 +1783,42 @@ "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", "version": "0.0.0" } + }, + "vpcPeeringRoute": { + "id": "vpcPeeringRoute", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/TestRoottable/vpcPeeringRoute", + "children": { + "Route": { + "id": "Route", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/TestRoottable/vpcPeeringRoute/Route", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "routeTableId": { + "Fn::GetAtt": [ + "TestRoottableRouteTableFA28AA38", + "RouteTableId" + ] + }, + "vpcPeeringConnectionId": { + "Fn::GetAtt": [ + "crossAccountCrossRegionPeeringPeeringConnection1503A608", + "Id" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2-alpha.Route", + "version": "0.0.0" + } } }, "constructInfo": { @@ -1771,76 +1826,246 @@ "version": "0.0.0" } }, - "vpcpcSubnet": { - "id": "vpcpcSubnet", - "path": "aws-cdk-routev2-vpcpeerconnection-alpha/vpcpcSubnet", + "secondVPC": { + "id": "secondVPC", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/secondVPC", "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-cdk-routev2-vpcpeerconnection-alpha/vpcpcSubnet/Subnet", + "Resource": { + "id": "Resource", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/secondVPC/Resource", "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { - "assignIpv6AddressOnCreation": false, - "availabilityZone": "us-east-1a", - "cidrBlock": "10.0.0.0/24", - "ipv6CidrBlock": { - "Fn::Select": [ - 0, - { - "Fn::GetAtt": [ - "vpcpc6CAE1A04", - "Ipv6CidrBlocks" - ] - } - ] - }, + "cidrBlock": "10.1.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "Temp Block": { + "id": "Temp Block", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/secondVPC/Temp Block", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.2.0.0/16", "vpcId": { "Fn::GetAtt": [ - "vpcpc6CAE1A04", + "secondVPCFBB45262", "VpcId" ] } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCCidrBlock", "version": "0.0.0" } - }, - "Acl": { - "id": "Acl", - "path": "aws-cdk-routev2-vpcpeerconnection-alpha/vpcpcSubnet/Acl", + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2-alpha.VpcV2", + "version": "0.0.0" + } + }, + "crossAccountCrossRegionPeering": { + "id": "crossAccountCrossRegionPeering", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering", + "children": { + "PeerRole": { + "id": "PeerRole", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeerRole", + "children": { + "ImportPeerRole": { + "id": "ImportPeerRole", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeerRole/ImportPeerRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeerRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + }, + "roleName": "VPCPeeringRole-crossAccountCrossRegionPeering" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeerRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeerRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "ec2:acceptVpcPeeringConnection", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:us-west-2:123456789012:vpc/", + { + "Fn::GetAtt": [ + "secondVPCFBB45262", + "VpcId" + ] + } + ] + ] + } + }, + { + "Action": "ec2:acceptVpcPeeringConnection", + "Condition": { + "StringEquals": { + "ec2:AccepterVpc": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:us-west-2:123456789012:vpc/", + { + "Fn::GetAtt": [ + "secondVPCFBB45262", + "VpcId" + ] + } + ] + ] + } + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:us-west-2:123456789012:vpc-peering-connection/*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "crossAccountCrossRegionPeeringPeerRoleDefaultPolicy4F428B82", + "roles": [ + { + "Ref": "crossAccountCrossRegionPeeringPeerRoleA26F8D4F" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "aws-cdk-lib.aws_iam.Role", "version": "0.0.0" } }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-cdk-routev2-vpcpeerconnection-alpha/vpcpcSubnet/RouteTableAssociation", + "PeeringConnection": { + "id": "PeeringConnection", + "path": "aws-cdk-routev2-vpcpeerconnection-alpha/crossAccountCrossRegionPeering/PeeringConnection", "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:type": "AWS::EC2::VPCPeeringConnection", "aws:cdk:cloudformation:props": { - "routeTableId": { + "peerOwnerId": "123456789012", + "peerRegion": "us-west-2", + "peerRoleArn": { "Fn::GetAtt": [ - "TestRoottableRouteTableFA28AA38", - "RouteTableId" + "crossAccountCrossRegionPeeringPeerRoleA26F8D4F", + "Arn" ] }, - "subnetId": { - "Ref": "vpcpcSubnet1DD6CE35" + "peerVpcId": { + "Fn::GetAtt": [ + "secondVPCFBB45262", + "VpcId" + ] + }, + "vpcId": { + "Fn::GetAtt": [ + "vpcpc6CAE1A04", + "VpcId" + ] } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCPeeringConnection", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2-alpha.SubnetV2", + "fqn": "@aws-cdk/aws-ec2-alpha.VPCPeeringConnection", "version": "0.0.0" } }, @@ -1944,7 +2169,7 @@ "id": "dynamoRoute", "path": "aws-cdk-routev2-dynamodbendpoint-alpha/TestRoottable/dynamoRoute", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-ec2-alpha.Route", "version": "0.0.0" } } diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.ts b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.ts index 4f9d98b92471f..ea8046ef4dc89 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.ts +++ b/packages/@aws-cdk/aws-ec2-alpha/test/integ.route-v2.ts @@ -12,7 +12,7 @@ import * as vpc_v2 from '../lib/vpc-v2'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; import * as cdk from 'aws-cdk-lib'; import { IpCidr, SubnetV2 } from '../lib/subnet-v2'; -import { EgressOnlyInternetGateway, InternetGateway, NatConnectivityType, NatGateway, RouteTable, VPNGatewayV2 } from '../lib/route'; +import { EgressOnlyInternetGateway, InternetGateway, NatConnectivityType, NatGateway, RouteTable, VPCPeeringConnection, VPNGatewayV2 } from '../lib/route'; import { GatewayVpcEndpoint, GatewayVpcEndpointAwsService, SubnetType, VpnConnectionType } from 'aws-cdk-lib/aws-ec2'; import { Fn } from 'aws-cdk-lib'; @@ -57,7 +57,7 @@ for (const stackName in stacks) { routeTable: routeTables[stackName], }); subnets[stackName] = subnet; - } else { + } else if (stackName != 'vpcpc') { // use empty ipv6 that doesn't overlap const subnet = new SubnetV2(stacks[stackName], stackName + 'Subnet', { vpc: vpc, @@ -115,6 +115,20 @@ const dynamoEndpoint = new GatewayVpcEndpoint(stacks.dynamodb, 'testDynamoEndpoi }); routeTables.dynamodb.addRoute('dynamoRoute', '0.0.0.0/0', { endpoint: dynamoEndpoint }); +const vpc2 = new vpc_v2.VpcV2(stacks.vpcpc, 'secondVPC', { + primaryAddressBlock: vpc_v2.IpAddresses.ipv4('10.1.0.0/16'), + secondaryAddressBlocks: [vpc_v2.IpAddresses.ipv4('10.2.0.0/16', { cidrBlockName: 'Temp Block' })], +}); + +const peeringConnection = new VPCPeeringConnection(stacks.vpcpc, 'crossAccountCrossRegionPeering', { + isCrossAccount: true, + requestorVpc: vpcs.vpcpc, + acceptorVpc: vpc2, + acceptorAccountId: '123456789012', + acceptorRegion: 'us-west-2', +}); +routeTables.vpcpc.addRoute('vpcPeeringRoute', '0.0.0.0/0', { gateway: peeringConnection }); + var i = 0; for (const stackName in stacks) { new IntegTest(app, 'integtest-model-' + i, {