From a02566589c52fcc11f22d9921644d2afc4970c19 Mon Sep 17 00:00:00 2001 From: shikha372 Date: Fri, 14 Jun 2024 15:21:29 -0700 Subject: [PATCH] addressing last feedback comments --- packages/@aws-cdk/aws-vpcv2-alpha/lib/ipam.ts | 67 ++- .../@aws-cdk/aws-vpcv2-alpha/lib/vpc-v2.ts | 11 +- .../aws-cdk-vpcv2-alpha-new.assets.json | 19 + .../aws-cdk-vpcv2-alpha-new.template.json | 168 +++++++ .../test/integ.subnet-v2.js.snapshot/cdk.out | 1 + .../integ.subnet-v2.js.snapshot/integ.json | 12 + ...efaultTestDeployAssertCF40BD53.assets.json | 19 + ...aultTestDeployAssertCF40BD53.template.json | 36 ++ .../integ.subnet-v2.js.snapshot/manifest.json | 173 +++++++ .../integ.subnet-v2.js.snapshot/tree.json | 355 ++++++++++++++ .../aws-vpcv2-alpha/test/integ.subnet-v2.ts | 13 +- .../aws-cdk-vpcv2-alpha.assets.json | 19 + .../aws-cdk-vpcv2-alpha.template.json | 216 ++++++++ .../integ.vpc-v2-alpha.js.snapshot/cdk.out | 1 + .../integ.vpc-v2-alpha.js.snapshot/integ.json | 12 + ...efaultTestDeployAssertCF40BD53.assets.json | 19 + ...aultTestDeployAssertCF40BD53.template.json | 36 ++ .../manifest.json | 197 ++++++++ .../integ.vpc-v2-alpha.js.snapshot/tree.json | 462 ++++++++++++++++++ .../test/integ.vpc-v2-alpha.ts | 28 +- 20 files changed, 1808 insertions(+), 56 deletions(-) create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.assets.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.template.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/tree.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.assets.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.template.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/lib/ipam.ts b/packages/@aws-cdk/aws-vpcv2-alpha/lib/ipam.ts index fe8d6a0cadd61..926feab1c4e97 100644 --- a/packages/@aws-cdk/aws-vpcv2-alpha/lib/ipam.ts +++ b/packages/@aws-cdk/aws-vpcv2-alpha/lib/ipam.ts @@ -19,14 +19,18 @@ function getAddressFamilyString(addressFamily: AddressFamily): string { } } +export interface CfnPoolOptions extends PoolOptions { + readonly ipamScopeId: string; +} + export interface PoolOptions{ readonly addressFamily: AddressFamily; readonly provisionedCidrs: CfnIPAMPool.ProvisionedCidrProperty[]; - readonly region?: string; + readonly locale?: string; } export interface IpamScopeOptions { - readonly ipamID: string; + readonly ipamId: string; } export interface IpamOptions { @@ -60,6 +64,23 @@ export interface IpamOptions { readonly ipv6IpamPoolId?: string; } +export class IpamPool { + + public readonly ipamPoolId: string; + public readonly pool: CfnIPAMPool; + constructor(scope: Construct, id: string, options: CfnPoolOptions) { + + const CfnPool = new CfnIPAMPool(scope, id, { + addressFamily: getAddressFamilyString(options.addressFamily), + provisionedCidrs: options.provisionedCidrs, + locale: options.locale, + ipamScopeId: options.ipamScopeId, + }); + this.ipamPoolId = CfnPool.attrIpamPoolId; + this.pool = CfnPool; + } +} + export class IpamIpv4 implements IIpAddresses { constructor(private readonly props: IpamOptions) { @@ -85,7 +106,7 @@ export class IpamScope extends Resource { constructor(scope: Construct, id: string, props: IpamScopeOptions) { super(scope, id); this._ipamScope = new CfnIPAMScope(scope, 'IpamScope', { - ipamId: props.ipamID, + ipamId: props.ipamId, }); this.ipamScopeId = this._ipamScope.attrIpamScopeId; } @@ -103,19 +124,19 @@ export class Ipam { // Resource IPAM private readonly _ipam: CfnIPAM; // can be used later to add a custom private scope - public readonly ipamID: string; + public readonly ipamId: string; constructor(scope: Construct, id: string) { this._ipam = new CfnIPAM(scope, id); this.publicScope = new IpamPublicScope(scope, this._ipam.attrPublicDefaultScopeId); this.privateScope = new IpamPrivateScope(scope, this._ipam.attrPrivateDefaultScopeId); - this.ipamID = this._ipam.attrIpamId; + this.ipamId = this._ipam.attrIpamId; } } export class IpamPublicScope { public readonly defaultpublicScopeId: string; - private readonly scope: Construct; + public readonly scope: Construct; constructor(scope: Construct, id: string) { this.defaultpublicScopeId = id; @@ -126,17 +147,17 @@ export class IpamPublicScope { * There can be multiple options supported under a scope * for pool like using amazon provided IPv6 */ - addPool(options: PoolOptions): CfnIPAMPool { + addPool(options: PoolOptions): IpamPool { /** * creates pool under default public scope (IPV4, IPV6) */ - return new CfnIPAMPool(this.scope, 'TestPool', { - addressFamily: getAddressFamilyString(options.addressFamily), + return new IpamPool(this.scope, 'PublicPool', { + addressFamily: options.addressFamily, provisionedCidrs: options.provisionedCidrs, ipamScopeId: this.defaultpublicScopeId, //TODO: should be stack region or props input - locale: options.region, + locale: options.locale, }); } } @@ -147,7 +168,7 @@ export class IpamPublicScope { export class IpamPrivateScope { public readonly defaultprivateScopeId: string; - private readonly scope: Construct; + public readonly scope: Construct; constructor(scope: Construct, id: string) { this.defaultprivateScopeId = id; @@ -158,28 +179,21 @@ export class IpamPrivateScope { * There can be multiple options supported under a scope * for pool like using amazon provided IPv6 */ - addPool(options: PoolOptions): CfnIPAMPool { + addPool(options: PoolOptions):IpamPool { - /** - * creates pool under default public scope (IPV4, IPV6) - */ - return new CfnIPAMPool(this.scope, 'TestPool', { - addressFamily: getAddressFamilyString(options.addressFamily), + return new IpamPool(this.scope, 'PrivatePool', { + addressFamily: options.addressFamily, provisionedCidrs: options.provisionedCidrs, ipamScopeId: this.defaultprivateScopeId, //TODO: should be stack region or props input - locale: options.region, + locale: options.locale, }); + /** + * creates pool under default public scope (IPV4, IPV6) + */ } } -//Customer Implementation Example -// const ipam = new Ipam(this, 'Ipam'); -// ipam.publicScope.addPool({ -// addressFamily: AddressFamily.IP_V4, -// provisionedCidrs: [{ cidr: '10.0.0.0/24' }], -// }); - export class IpamIpv6 implements IIpAddresses { constructor(private readonly props: IpamOptions) { @@ -191,4 +205,5 @@ export class IpamIpv6 implements IIpAddresses { ipv6IpamPoolId: this.props.ipv6IpamPoolId, }; } -} \ No newline at end of file +} + diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/lib/vpc-v2.ts b/packages/@aws-cdk/aws-vpcv2-alpha/lib/vpc-v2.ts index 43d5a8e13bd10..b5aa1ff6eface 100644 --- a/packages/@aws-cdk/aws-vpcv2-alpha/lib/vpc-v2.ts +++ b/packages/@aws-cdk/aws-vpcv2-alpha/lib/vpc-v2.ts @@ -328,13 +328,8 @@ function validateIpv4address(cidr1?: string, cidr2?: string): boolean { octet2: octetsCidr2[1], }; - if ( - (ip1.octet1 === 10 && ip2.octet1 === 10) || + return (ip1.octet1 === 10 && ip2.octet1 === 10) || (ip1.octet1 === 192 && ip1.octet2 === 168 && ip2.octet1 === 192 && ip2.octet2 === 168) || - (ip1.octet1 === 172 && ip1.octet2 === 16 && ip2.octet1 === 172 && ip2.octet2 === 16) - ) { - return true; // CIDR ranges belong to same private IP address ranges - } else { - return false; - } // CIDR ranges do not belong to same private IP address ranges + (ip1.octet1 === 172 && ip1.octet2 === 16 && ip2.octet1 === 172 && ip2.octet2 === 16); + return true; // CIDR ranges belong to same private IP address ranges } diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.assets.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.assets.json new file mode 100644 index 0000000000000..79f70b14bae98 --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "441acbb4f96789feb207fab29ab31bbaa9e73d499b52cabf7ff2bc7763db0a17": { + "source": { + "path": "aws-cdk-vpcv2-alpha-new.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "441acbb4f96789feb207fab29ab31bbaa9e73d499b52cabf7ff2bc7763db0a17.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.template.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.template.json new file mode 100644 index 0000000000000..8cc75c7b08364 --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.template.json @@ -0,0 +1,168 @@ +{ + "Resources": { + "Ipam": { + "Type": "AWS::EC2::IPAM" + }, + "PrivatePool": { + "Type": "AWS::EC2::IPAMPool", + "Properties": { + "AddressFamily": "ipv4", + "IpamScopeId": { + "Fn::GetAtt": [ + "Ipam", + "PrivateDefaultScopeId" + ] + }, + "Locale": "us-west-2", + "ProvisionedCidrs": [ + { + "Cidr": "10.2.0.0/16" + } + ] + } + }, + "VPCTestFB735C86": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true + } + }, + "VPCTestSecondaryIp1BB4FC62E": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "Ipv4IpamPoolId": { + "Fn::GetAtt": [ + "PrivatePool", + "IpamPoolId" + ] + }, + "Ipv4NetmaskLength": 20, + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "VPCTestSecondaryIp24E984B36": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "AmazonProvidedIpv6CidrBlock": true, + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "VPCTestVpnGateway51EEED38": { + "Type": "AWS::EC2::VPNGateway", + "Properties": { + "Type": "ipsec.1" + } + }, + "VPCTestVPCVPNGW0A869280": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + }, + "VpnGatewayId": { + "Ref": "VPCTestVpnGateway51EEED38" + } + } + }, + "VPCTestRoutePropagationFEA3011A": { + "Type": "AWS::EC2::VPNGatewayRoutePropagation", + "Properties": { + "RouteTableIds": [ + { + "Ref": "testsbubnetRouteTableF40F025B" + } + ], + "VpnGatewayId": { + "Ref": "VPCTestVpnGateway51EEED38" + } + }, + "DependsOn": [ + "VPCTestVPCVPNGW0A869280" + ] + }, + "testsbubnetSubnet77337845": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-west-2a", + "CidrBlock": "10.0.0.0/24", + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testsbubnetRouteTableF40F025B": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testsbubnetRouteTableAssociationD6D083FA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "testsbubnetRouteTableF40F025B" + }, + "SubnetId": { + "Ref": "testsbubnetSubnet77337845" + } + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/cdk.out b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integ.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integ.json new file mode 100644 index 0000000000000..321da99978a8c --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "integtest-model/DefaultTest": { + "stacks": [ + "aws-cdk-vpcv2-alpha-new" + ], + "assertionStack": "integtest-model/DefaultTest/DeployAssert", + "assertionStackName": "integtestmodelDefaultTestDeployAssertCF40BD53" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json new file mode 100644 index 0000000000000..3dba4ef9b8bab --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "integtestmodelDefaultTestDeployAssertCF40BD53.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/manifest.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/manifest.json new file mode 100644 index 0000000000000..d033b3f3e69a2 --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/manifest.json @@ -0,0 +1,173 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-cdk-vpcv2-alpha-new.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-vpcv2-alpha-new.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-vpcv2-alpha-new": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-vpcv2-alpha-new.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "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}/441acbb4f96789feb207fab29ab31bbaa9e73d499b52cabf7ff2bc7763db0a17.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-vpcv2-alpha-new.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-vpcv2-alpha-new.assets" + ], + "metadata": { + "/aws-cdk-vpcv2-alpha-new/Ipam": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipam" + } + ], + "/aws-cdk-vpcv2-alpha-new/PrivatePool": [ + { + "type": "aws:cdk:logicalId", + "data": "PrivatePool" + } + ], + "/aws-cdk-vpcv2-alpha-new/VPCTest/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestFB735C86" + } + ], + "/aws-cdk-vpcv2-alpha-new/VPCTest/SecondaryIp1": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestSecondaryIp1BB4FC62E" + } + ], + "/aws-cdk-vpcv2-alpha-new/VPCTest/SecondaryIp2": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestSecondaryIp24E984B36" + } + ], + "/aws-cdk-vpcv2-alpha-new/VPCTest/VpnGateway/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestVpnGateway51EEED38" + } + ], + "/aws-cdk-vpcv2-alpha-new/VPCTest/VPCVPNGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestVPCVPNGW0A869280" + } + ], + "/aws-cdk-vpcv2-alpha-new/VPCTest/RoutePropagation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestRoutePropagationFEA3011A" + } + ], + "/aws-cdk-vpcv2-alpha-new/testsbubnet/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "testsbubnetSubnet77337845" + } + ], + "/aws-cdk-vpcv2-alpha-new/testsbubnet/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "testsbubnetRouteTableF40F025B" + } + ], + "/aws-cdk-vpcv2-alpha-new/testsbubnet/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "testsbubnetRouteTableAssociationD6D083FA" + } + ], + "/aws-cdk-vpcv2-alpha-new/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-vpcv2-alpha-new/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-vpcv2-alpha-new" + }, + "integtestmodelDefaultTestDeployAssertCF40BD53.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integtestmodelDefaultTestDeployAssertCF40BD53.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integtestmodelDefaultTestDeployAssertCF40BD53": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integtestmodelDefaultTestDeployAssertCF40BD53.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "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", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integtestmodelDefaultTestDeployAssertCF40BD53.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integtestmodelDefaultTestDeployAssertCF40BD53.assets" + ], + "metadata": { + "/integtest-model/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integtest-model/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integtest-model/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/tree.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/tree.json new file mode 100644 index 0000000000000..643614720b36f --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.js.snapshot/tree.json @@ -0,0 +1,355 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-vpcv2-alpha-new": { + "id": "aws-cdk-vpcv2-alpha-new", + "path": "aws-cdk-vpcv2-alpha-new", + "children": { + "Ipam": { + "id": "Ipam", + "path": "aws-cdk-vpcv2-alpha-new/Ipam", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::IPAM", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnIPAM", + "version": "0.0.0" + } + }, + "PrivatePool": { + "id": "PrivatePool", + "path": "aws-cdk-vpcv2-alpha-new/PrivatePool", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::IPAMPool", + "aws:cdk:cloudformation:props": { + "addressFamily": "ipv4", + "ipamScopeId": { + "Fn::GetAtt": [ + "Ipam", + "PrivateDefaultScopeId" + ] + }, + "locale": "us-west-2", + "provisionedCidrs": [ + { + "cidr": "10.2.0.0/16" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnIPAMPool", + "version": "0.0.0" + } + }, + "VPCTest": { + "id": "VPCTest", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "SecondaryIp1": { + "id": "SecondaryIp1", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest/SecondaryIp1", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "ipv4IpamPoolId": { + "Fn::GetAtt": [ + "PrivatePool", + "IpamPoolId" + ] + }, + "ipv4NetmaskLength": 20, + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCCidrBlock", + "version": "0.0.0" + } + }, + "SecondaryIp2": { + "id": "SecondaryIp2", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest/SecondaryIp2", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "amazonProvidedIpv6CidrBlock": true, + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCCidrBlock", + "version": "0.0.0" + } + }, + "VpnGateway": { + "id": "VpnGateway", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest/VpnGateway", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest/VpnGateway/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPNGateway", + "aws:cdk:cloudformation:props": { + "type": "ipsec.1" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPNGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.VpnGateway", + "version": "0.0.0" + } + }, + "VPCVPNGW": { + "id": "VPCVPNGW", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest/VPCVPNGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + }, + "vpnGatewayId": { + "Ref": "VPCTestVpnGateway51EEED38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + }, + "RoutePropagation": { + "id": "RoutePropagation", + "path": "aws-cdk-vpcv2-alpha-new/VPCTest/RoutePropagation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPNGatewayRoutePropagation", + "aws:cdk:cloudformation:props": { + "routeTableIds": [ + { + "Ref": "testsbubnetRouteTableF40F025B" + } + ], + "vpnGatewayId": { + "Ref": "VPCTestVpnGateway51EEED38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPNGatewayRoutePropagation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-vpcv2-alpha.VpcV2", + "version": "0.0.0" + } + }, + "testsbubnet": { + "id": "testsbubnet", + "path": "aws-cdk-vpcv2-alpha-new/testsbubnet", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-vpcv2-alpha-new/testsbubnet/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": "us-west-2a", + "cidrBlock": "10.0.0.0/24", + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-vpcv2-alpha-new/testsbubnet/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-vpcv2-alpha-new/testsbubnet/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-vpcv2-alpha-new/testsbubnet/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "testsbubnetRouteTableF40F025B" + }, + "subnetId": { + "Ref": "testsbubnetSubnet77337845" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-vpcv2-alpha-new/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-vpcv2-alpha-new/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "integtest-model": { + "id": "integtest-model", + "path": "integtest-model", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "integtest-model/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "integtest-model/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "integtest-model/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integtest-model/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integtest-model/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.ts b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.ts index 4958688a938b8..c95dea42bc726 100644 --- a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.ts +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.subnet-v2.ts @@ -13,7 +13,6 @@ import { AddressFamily, Ipam } from '../lib'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; import * as cdk from 'aws-cdk-lib'; import { Ipv4Cidr, /*Ipv6Cidr,*/ SubnetV2 } from '../lib/subnet-v2'; -import { log } from 'console'; import { SubnetType } from 'aws-cdk-lib/aws-ec2'; // as in unit tests, we use a qualified import, @@ -26,17 +25,17 @@ const stack = new cdk.Stack(app, 'aws-cdk-vpcv2-alpha-new'); const ipam = new Ipam(stack, 'Ipam'); -const pool = ipam.publicScope.addPool({ +const pool = ipam.privateScope.addPool({ addressFamily: AddressFamily.IP_V4, provisionedCidrs: [{ cidr: '10.2.0.0/16' }], - region: 'us-east-1', + locale: 'us-west-2', }); const vpc = new vpc_v2.VpcV2(stack, 'VPCTest', { primaryAddressBlock: vpc_v2.IpAddresses.ipv4('10.0.0.0/16'), secondaryAddressBlocks: [ vpc_v2.IpAddresses.ipv4Ipam({ - ipv4IpamPoolId: pool.attrIpamPoolId, + ipv4IpamPoolId: pool.ipamPoolId, ipv4NetmaskLength: 20, }), vpc_v2.IpAddresses.amazonProvidedIpv6(), @@ -53,7 +52,7 @@ new SubnetV2(stack, 'testsbubnet', { subnetType: SubnetType.PRIVATE_ISOLATED, }); -const selection = vpc.selectSubnets(); +//const selection = vpc.selectSubnets(); vpc.enableVpnGateway({ vpnRoutePropagation: [{ subnetType: SubnetType.PRIVATE_ISOLATED, // optional, defaults to "PUBLIC" @@ -61,9 +60,7 @@ vpc.enableVpnGateway({ type: 'ipsec.1', }); -log(selection); - -app.synth(); +//log(selection) new IntegTest(app, 'integtest-model', { testCases: [stack], diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.assets.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.assets.json new file mode 100644 index 0000000000000..38eb0e864856b --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "e53082d7f24b08bd820fd7f8498bcdf5b7d80caf9c938df63fa19eac80c4d421": { + "source": { + "path": "aws-cdk-vpcv2-alpha.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "e53082d7f24b08bd820fd7f8498bcdf5b7d80caf9c938df63fa19eac80c4d421.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.template.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.template.json new file mode 100644 index 0000000000000..167fca5779091 --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/aws-cdk-vpcv2-alpha.template.json @@ -0,0 +1,216 @@ +{ + "Resources": { + "Ipam": { + "Type": "AWS::EC2::IPAM" + }, + "PublicPool": { + "Type": "AWS::EC2::IPAMPool", + "Properties": { + "AddressFamily": "ipv4", + "IpamScopeId": { + "Fn::GetAtt": [ + "Ipam", + "PublicDefaultScopeId" + ] + }, + "Locale": "us-east-1", + "ProvisionedCidrs": [ + { + "Cidr": "10.2.0.0/16" + } + ] + } + }, + "VPCTestFB735C86": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true + } + }, + "VPCTestSecondaryIp1BB4FC62E": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "Ipv4IpamPoolId": { + "Fn::GetAtt": [ + "PublicPool", + "IpamPoolId" + ] + }, + "Ipv4NetmaskLength": 20, + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "VPCTestSecondaryIp24E984B36": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "AmazonProvidedIpv6CidrBlock": true, + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testsbubnetSubnet77337845": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-west-2a", + "CidrBlock": "10.0.0.0/24", + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testsbubnetRouteTableF40F025B": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testsbubnetRouteTableAssociationD6D083FA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "testsbubnetRouteTableF40F025B" + }, + "SubnetId": { + "Ref": "testsbubnetSubnet77337845" + } + } + }, + "TestRoottableRouteTableFA28AA38": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testEOIGWEIGW54CCAD37": { + "Type": "AWS::EC2::EgressOnlyInternetGateway", + "Properties": { + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testDynamoEndpoint03D5BDE5": { + "Type": "AWS::EC2::VPCEndpoint", + "Properties": { + "RouteTableIds": [ + { + "Ref": "testsbubnetRouteTableF40F025B" + } + ], + "ServiceName": { + "Fn::Join": [ + "", + [ + "com.amazonaws.", + { + "Ref": "AWS::Region" + }, + ".dynamodb" + ] + ] + }, + "VpcEndpointType": "Gateway", + "VpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "testEIGWRouteEB4FE8D5": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "10.0.0.0/25", + "EgressOnlyInternetGatewayId": { + "Fn::GetAtt": [ + "testEOIGWEIGW54CCAD37", + "Id" + ] + }, + "RouteTableId": { + "Fn::GetAtt": [ + "TestRoottableRouteTableFA28AA38", + "RouteTableId" + ] + } + } + }, + "testDynamoRoute00B9A4E7": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "10.0.0.128/25", + "RouteTableId": { + "Fn::GetAtt": [ + "TestRoottableRouteTableFA28AA38", + "RouteTableId" + ] + }, + "VpcEndpointId": { + "Ref": "testDynamoEndpoint03D5BDE5" + } + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/cdk.out b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integ.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integ.json new file mode 100644 index 0000000000000..c583ba29c25f7 --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "integtest-model/DefaultTest": { + "stacks": [ + "aws-cdk-vpcv2-alpha" + ], + "assertionStack": "integtest-model/DefaultTest/DeployAssert", + "assertionStackName": "integtestmodelDefaultTestDeployAssertCF40BD53" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json new file mode 100644 index 0000000000000..3dba4ef9b8bab --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "integtestmodelDefaultTestDeployAssertCF40BD53.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/integtestmodelDefaultTestDeployAssertCF40BD53.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/manifest.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/manifest.json new file mode 100644 index 0000000000000..206d1a44d83b5 --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/manifest.json @@ -0,0 +1,197 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-cdk-vpcv2-alpha.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-vpcv2-alpha.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-vpcv2-alpha": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-vpcv2-alpha.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "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}/e53082d7f24b08bd820fd7f8498bcdf5b7d80caf9c938df63fa19eac80c4d421.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-vpcv2-alpha.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-vpcv2-alpha.assets" + ], + "metadata": { + "/aws-cdk-vpcv2-alpha/Ipam": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipam" + } + ], + "/aws-cdk-vpcv2-alpha/PublicPool": [ + { + "type": "aws:cdk:logicalId", + "data": "PublicPool" + } + ], + "/aws-cdk-vpcv2-alpha/VPCTest/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestFB735C86" + } + ], + "/aws-cdk-vpcv2-alpha/VPCTest/SecondaryIp1": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestSecondaryIp1BB4FC62E", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] + } + ], + "/aws-cdk-vpcv2-alpha/VPCTest/SecondaryIp2": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCTestSecondaryIp24E984B36" + } + ], + "/aws-cdk-vpcv2-alpha/testsbubnet/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "testsbubnetSubnet77337845" + } + ], + "/aws-cdk-vpcv2-alpha/testsbubnet/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "testsbubnetRouteTableF40F025B" + } + ], + "/aws-cdk-vpcv2-alpha/testsbubnet/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "testsbubnetRouteTableAssociationD6D083FA" + } + ], + "/aws-cdk-vpcv2-alpha/TestRoottable/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "TestRoottableRouteTableFA28AA38" + } + ], + "/aws-cdk-vpcv2-alpha/testEOIGW/EIGW": [ + { + "type": "aws:cdk:logicalId", + "data": "testEOIGWEIGW54CCAD37" + } + ], + "/aws-cdk-vpcv2-alpha/testDynamoEndpoint/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testDynamoEndpoint03D5BDE5" + } + ], + "/aws-cdk-vpcv2-alpha/testEIGWRoute/Route": [ + { + "type": "aws:cdk:logicalId", + "data": "testEIGWRouteEB4FE8D5" + } + ], + "/aws-cdk-vpcv2-alpha/testDynamoRoute/Route": [ + { + "type": "aws:cdk:logicalId", + "data": "testDynamoRoute00B9A4E7" + } + ], + "/aws-cdk-vpcv2-alpha/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-vpcv2-alpha/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ], + "PrivatePool": [ + { + "type": "aws:cdk:logicalId", + "data": "PrivatePool", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ] + }, + "displayName": "aws-cdk-vpcv2-alpha" + }, + "integtestmodelDefaultTestDeployAssertCF40BD53.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integtestmodelDefaultTestDeployAssertCF40BD53.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integtestmodelDefaultTestDeployAssertCF40BD53": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integtestmodelDefaultTestDeployAssertCF40BD53.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "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", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integtestmodelDefaultTestDeployAssertCF40BD53.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integtestmodelDefaultTestDeployAssertCF40BD53.assets" + ], + "metadata": { + "/integtest-model/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integtest-model/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integtest-model/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/tree.json b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/tree.json new file mode 100644 index 0000000000000..2f86db406323d --- /dev/null +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.js.snapshot/tree.json @@ -0,0 +1,462 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-vpcv2-alpha": { + "id": "aws-cdk-vpcv2-alpha", + "path": "aws-cdk-vpcv2-alpha", + "children": { + "Ipam": { + "id": "Ipam", + "path": "aws-cdk-vpcv2-alpha/Ipam", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::IPAM", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnIPAM", + "version": "0.0.0" + } + }, + "PublicPool": { + "id": "PublicPool", + "path": "aws-cdk-vpcv2-alpha/PublicPool", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::IPAMPool", + "aws:cdk:cloudformation:props": { + "addressFamily": "ipv4", + "ipamScopeId": { + "Fn::GetAtt": [ + "Ipam", + "PublicDefaultScopeId" + ] + }, + "locale": "us-east-1", + "provisionedCidrs": [ + { + "cidr": "10.2.0.0/16" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnIPAMPool", + "version": "0.0.0" + } + }, + "VPCTest": { + "id": "VPCTest", + "path": "aws-cdk-vpcv2-alpha/VPCTest", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpcv2-alpha/VPCTest/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "SecondaryIp1": { + "id": "SecondaryIp1", + "path": "aws-cdk-vpcv2-alpha/VPCTest/SecondaryIp1", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "ipv4IpamPoolId": { + "Fn::GetAtt": [ + "PublicPool", + "IpamPoolId" + ] + }, + "ipv4NetmaskLength": 20, + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCCidrBlock", + "version": "0.0.0" + } + }, + "SecondaryIp2": { + "id": "SecondaryIp2", + "path": "aws-cdk-vpcv2-alpha/VPCTest/SecondaryIp2", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "amazonProvidedIpv6CidrBlock": true, + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCCidrBlock", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-vpcv2-alpha.VpcV2", + "version": "0.0.0" + } + }, + "testsbubnet": { + "id": "testsbubnet", + "path": "aws-cdk-vpcv2-alpha/testsbubnet", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-vpcv2-alpha/testsbubnet/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": "us-west-2a", + "cidrBlock": "10.0.0.0/24", + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-vpcv2-alpha/testsbubnet/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-vpcv2-alpha/testsbubnet/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-vpcv2-alpha/testsbubnet/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "testsbubnetRouteTableF40F025B" + }, + "subnetId": { + "Ref": "testsbubnetSubnet77337845" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "TestRoottable": { + "id": "TestRoottable", + "path": "aws-cdk-vpcv2-alpha/TestRoottable", + "children": { + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-vpcv2-alpha/TestRoottable/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "testEOIGW": { + "id": "testEOIGW", + "path": "aws-cdk-vpcv2-alpha/testEOIGW", + "children": { + "EIGW": { + "id": "EIGW", + "path": "aws-cdk-vpcv2-alpha/testEOIGW/EIGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EgressOnlyInternetGateway", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEgressOnlyInternetGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "testDynamoEndpoint": { + "id": "testDynamoEndpoint", + "path": "aws-cdk-vpcv2-alpha/testDynamoEndpoint", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpcv2-alpha/testDynamoEndpoint/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCEndpoint", + "aws:cdk:cloudformation:props": { + "routeTableIds": [ + { + "Ref": "testsbubnetRouteTableF40F025B" + } + ], + "serviceName": { + "Fn::Join": [ + "", + [ + "com.amazonaws.", + { + "Ref": "AWS::Region" + }, + ".dynamodb" + ] + ] + }, + "vpcEndpointType": "Gateway", + "vpcId": { + "Fn::GetAtt": [ + "VPCTestFB735C86", + "VpcId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCEndpoint", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.GatewayVpcEndpoint", + "version": "0.0.0" + } + }, + "testEIGWRoute": { + "id": "testEIGWRoute", + "path": "aws-cdk-vpcv2-alpha/testEIGWRoute", + "children": { + "Route": { + "id": "Route", + "path": "aws-cdk-vpcv2-alpha/testEIGWRoute/Route", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "10.0.0.0/25", + "egressOnlyInternetGatewayId": { + "Fn::GetAtt": [ + "testEOIGWEIGW54CCAD37", + "Id" + ] + }, + "routeTableId": { + "Fn::GetAtt": [ + "TestRoottableRouteTableFA28AA38", + "RouteTableId" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "testDynamoRoute": { + "id": "testDynamoRoute", + "path": "aws-cdk-vpcv2-alpha/testDynamoRoute", + "children": { + "Route": { + "id": "Route", + "path": "aws-cdk-vpcv2-alpha/testDynamoRoute/Route", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "10.0.0.128/25", + "routeTableId": { + "Fn::GetAtt": [ + "TestRoottableRouteTableFA28AA38", + "RouteTableId" + ] + }, + "vpcEndpointId": { + "Ref": "testDynamoEndpoint03D5BDE5" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-vpcv2-alpha/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-vpcv2-alpha/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "integtest-model": { + "id": "integtest-model", + "path": "integtest-model", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "integtest-model/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "integtest-model/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "integtest-model/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integtest-model/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integtest-model/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.ts b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.ts index 01dd76601c2fc..0884236e7d3f4 100644 --- a/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.ts +++ b/packages/@aws-cdk/aws-vpcv2-alpha/test/integ.vpc-v2-alpha.ts @@ -15,7 +15,7 @@ import * as cdk from 'aws-cdk-lib'; import { Ipv4Cidr, /*Ipv6Cidr,*/ SubnetV2 } from '../lib/subnet-v2'; import { EgressOnlyInternetGateway, Route, RouteTable } from '../lib/route'; import { GatewayVpcEndpoint, GatewayVpcEndpointAwsService, RouterType, SubnetType } from 'aws-cdk-lib/aws-ec2'; -import { log } from 'console'; +//import { log } from 'console'; // as in unit tests, we use a qualified import, // not bring in individual classes @@ -30,14 +30,14 @@ const ipam = new Ipam(stack, 'Ipam'); const pool = ipam.publicScope.addPool({ addressFamily: AddressFamily.IP_V4, provisionedCidrs: [{ cidr: '10.2.0.0/16' }], - region: 'us-east-1', + locale: 'us-east-1', }); const vpc = new vpc_v2.VpcV2(stack, 'VPCTest', { primaryAddressBlock: vpc_v2.IpAddresses.ipv4('10.0.0.0/16'), secondaryAddressBlocks: [ vpc_v2.IpAddresses.ipv4Ipam({ - ipv4IpamPoolId: pool.attrIpamPoolId, + ipv4IpamPoolId: pool.ipamPoolId, ipv4NetmaskLength: 20, }), vpc_v2.IpAddresses.amazonProvidedIpv6(), @@ -54,14 +54,14 @@ new SubnetV2(stack, 'testsbubnet', { subnetType: SubnetType.PRIVATE_WITH_EGRESS, }); -const selection = vpc.selectSubnets(); -log(selection); -vpc.enableVpnGateway({ - vpnRoutePropagation: [{ - subnetType: SubnetType.PRIVATE_WITH_EGRESS, // optional, defaults to "PUBLIC" - }], - type: 'ipsec.1', -}); +// const selection = vpc.selectSubnets(); +// log(selection); +// vpc.enableVpnGateway({ +// vpnRoutePropagation: [{ +// subnetType: SubnetType.PRIVATE_WITH_EGRESS, // optional, defaults to "PUBLIC" +// }], +// type: 'ipsec.1', +// }); const routeTable = new RouteTable(stack, 'TestRoottable', { vpcId: vpc.vpcId, @@ -116,8 +116,8 @@ if (routeToEigw.targetRouterType != RouterType.EGRESS_ONLY_INTERNET_GATEWAY) { throw new Error('Egress Only Internet Gateway has wrong router type'); } -app.synth(); - new IntegTest(app, 'integtest-model', { testCases: [stack], -}); \ No newline at end of file +}); + +app.synth(); \ No newline at end of file