Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shikha372 committed Oct 15, 2024
1 parent 4ced705 commit 16f4634
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
8 changes: 0 additions & 8 deletions packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/test/ipam.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/test/subnet-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ec2-alpha/test/vpc-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Vpc V2 with full control', () => {
EnableDnsSupport: true,
},
},
TestVpcSecondaryAddressD76FCD9C: {
TestVpcSecondaryAddress72BC831D: {
Type: 'AWS::EC2::VPCCidrBlock',
Properties: {
VpcId: {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -235,7 +235,7 @@ describe('Vpc V2 with full control', () => {
EnableDnsSupport: true,
},
},
TestVpcIPv6Ipam178145A5: {
TestVpcIPv6Ipam402F1C75: {
Type: 'AWS::EC2::VPCCidrBlock',
Properties: {
VpcId: {
Expand Down

0 comments on commit 16f4634

Please sign in to comment.