From 3695d8c64e070efc9b3ea42384aaf24e12af18ce Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Tue, 26 Nov 2019 11:02:52 +0100 Subject: [PATCH] fix(ec2): CIDR for "any" IPv6 too long (#5179) Correct any IP range for IPv6 --- packages/@aws-cdk/aws-ec2/README.md | 2 +- packages/@aws-cdk/aws-ec2/lib/peer.ts | 2 +- .../@aws-cdk/cloudformation-diff/test/network/test.rule.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2/README.md b/packages/@aws-cdk/aws-ec2/README.md index 62f44423eeaba..76a0fa2918e72 100644 --- a/packages/@aws-cdk/aws-ec2/README.md +++ b/packages/@aws-cdk/aws-ec2/README.md @@ -300,7 +300,7 @@ There are various classes that implement the connection peer part: // Simple connection peers let peer = ec2.Peer.ipv4("10.0.0.0/16"); let peer = ec2.Peer.anyIpv4(); -let peer = ec2.Peer.ipv6("::0/0"); +let peer = ec2.Peer.ipv6("::/0"); let peer = ec2.Peer.anyIpv6(); let peer = ec2.Peer.prefixList("pl-12345"); fleet.connections.allowTo(peer, ec2.Port.tcp(443), 'Allow outbound HTTPS'); diff --git a/packages/@aws-cdk/aws-ec2/lib/peer.ts b/packages/@aws-cdk/aws-ec2/lib/peer.ts index 11f10df226765..0af091cb7b890 100644 --- a/packages/@aws-cdk/aws-ec2/lib/peer.ts +++ b/packages/@aws-cdk/aws-ec2/lib/peer.ts @@ -159,7 +159,7 @@ class CidrIPv6 implements IPeer { */ class AnyIPv6 extends CidrIPv6 { constructor() { - super("::0/0"); + super("::/0"); } } diff --git a/packages/@aws-cdk/cloudformation-diff/test/network/test.rule.ts b/packages/@aws-cdk/cloudformation-diff/test/network/test.rule.ts index c94113f9a5aca..f9245b4edc39e 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/network/test.rule.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/network/test.rule.ts @@ -26,12 +26,12 @@ export = { 'can parse cidr-ip 6'(test: Test) { const rule = new SecurityGroupRule({ - CidrIpv6: '::0/0' + CidrIpv6: '::/0' }); const peer = rule.peer!; if (peer.kind !== 'cidr-ip') { throw new Error('Fail'); } - test.equal(peer.ip, '::0/0'); + test.equal(peer.ip, '::/0'); test.done(); },