diff --git a/packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts b/packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts index f1c9ef45c048b..f43e316572453 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts +++ b/packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts @@ -400,15 +400,7 @@ export class VpcV2 extends VpcV2Base { throw new Error('CIDR block should be in the same RFC 1918 range in the VPC'); } } - if (secondaryVpcOptions.ipv4ProvisionedCidrs!) { - let isOverlap; - for (const provisionedCidr of secondaryVpcOptions.ipv4ProvisionedCidrs) { - isOverlap = validateIpv4address(provisionedCidr, secondaryVpcOptions.ipv4CidrBlock); - } - if (isOverlap === false) { - throw new Error('CIDR block should be in the same RFC 1918 range in the VPC'); - } this.ipv4ProvisionedCidrs?.push(...secondaryVpcOptions.ipv4ProvisionedCidrs); } const cfnVpcCidrBlock = new VPCCidrBlock(this, secondaryVpcOptions.cidrBlockName, { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/ipam.test.ts b/packages/@aws-cdk/aws-ec2-alpha/test/ipam.test.ts index aa3fd7884bccd..59d3ce4820176 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/ipam.test.ts +++ b/packages/@aws-cdk/aws-ec2-alpha/test/ipam.test.ts @@ -60,7 +60,7 @@ describe('IPAM Test', () => { }); new vpc.VpcV2(stack, 'TestVPC', { - primaryAddressBlock: vpc.IpAddresses.ipv4('10.2.0.0/16'), + primaryAddressBlock: vpc.IpAddresses.ipv4('10.1.0.0/16'), secondaryAddressBlocks: [vpc.IpAddresses.ipv4Ipam({ ipamPool: pool, netmaskLength: 20, diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/subnet-v2.test.ts b/packages/@aws-cdk/aws-ec2-alpha/test/subnet-v2.test.ts index caf371cc524d4..b43f9be207f74 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/subnet-v2.test.ts +++ b/packages/@aws-cdk/aws-ec2-alpha/test/subnet-v2.test.ts @@ -207,7 +207,7 @@ describe('Subnet V2 with custom IP and routing', () => { }, }, TestVPCD26570D8: { Type: 'AWS::EC2::VPC' }, - TestVPCipv6Ipam6024F9EC: { Type: 'AWS::EC2::VPCCidrBlock' }, + TestVPCipv6IpamFF061725: { Type: 'AWS::EC2::VPCCidrBlock' }, IpamSubnet78671F8A: { Type: 'AWS::EC2::Subnet', Properties: { diff --git a/packages/@aws-cdk/aws-ec2-alpha/test/vpc-v2.test.ts b/packages/@aws-cdk/aws-ec2-alpha/test/vpc-v2.test.ts index 5b2167ae3007b..6c3087ce42a77 100644 --- a/packages/@aws-cdk/aws-ec2-alpha/test/vpc-v2.test.ts +++ b/packages/@aws-cdk/aws-ec2-alpha/test/vpc-v2.test.ts @@ -56,7 +56,7 @@ describe('Vpc V2 with full control', () => { EnableDnsSupport: true, }, }, - TestVpcSecondaryAddressD76FCD9C: { + TestVpcSecondaryAddress72BC831D: { Type: 'AWS::EC2::VPCCidrBlock', Properties: { VpcId: { @@ -104,7 +104,7 @@ describe('Vpc V2 with full control', () => { EnableDnsSupport: true, }, }, - TestVpcAmazonProvided569F7097: { + TestVpcAmazonProvided00BF109D: { Type: 'AWS::EC2::VPCCidrBlock', Properties: { AmazonProvidedIpv6CidrBlock: true, //Amazon Provided IPv6 address @@ -235,7 +235,7 @@ describe('Vpc V2 with full control', () => { EnableDnsSupport: true, }, }, - TestVpcIPv6Ipam178145A5: { + TestVpcIPv6Ipam402F1C75: { Type: 'AWS::EC2::VPCCidrBlock', Properties: { VpcId: {