Skip to content

Commit

Permalink
fix(ec2): CIDR for "any" IPv6 too long (#5179)
Browse files Browse the repository at this point in the history
Correct any IP range for IPv6
  • Loading branch information
rix0rrr authored Nov 26, 2019
1 parent d2a86a5 commit 3695d8c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2/lib/peer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class CidrIPv6 implements IPeer {
*/
class AnyIPv6 extends CidrIPv6 {
constructor() {
super("::0/0");
super("::/0");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down

0 comments on commit 3695d8c

Please sign in to comment.