Confusing Error: InvalidCidrRangeError: x.x.x.x/11 is not a valid VPC CIDR
See original GitHub issueThis 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:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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)
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.