question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Confusing Error: InvalidCidrRangeError: x.x.x.x/11 is not a valid VPC CIDR

See original GitHub issue

This was totally my fault - I found out afterwords that a VPC has to be atleast a /16…

However if you try to use a /8:

    const vpc = new ec2.Vpc(this, 'privateVpc', {
       cidr: '10.0.0.0/8'
    });

    const cacheSubnet  = new ec2.Subnet(this, 'cacheSubnet', {
      vpcId: vpc.vpcId,
      cidrBlock: '10.0.0.0/24',
    });

Your told InvalidCidrRangeError: x.x.x.x/11 is not a valid VPC CIDR range (must be between /16 and /28) when you later try to create a subnet.

Clearly, its trying to calculate a subnet based on the assumption that the user followed the rules, but then spits out nonsense…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sblackstonecommented, Feb 2, 2021

@smit8995 This is more of a documentation/better error message bug rather than an issue with the CDK’s implemntation… Make sure you are using a /16 or smaller for your VPC…

And by smaller, I mean /17, /18 (larger mask = smaller subnet)

0reactions
github-actions[bot]commented, Jun 3, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found