VPC/CIDR IPv4 issue

0

Hello, Good day. Just started learning how to write IAAC on Cloud Formation using my text editor and I noticed something I don't understand.

Scenario 1 : If i create a VPC with an IPv4 CIDR (10.0.1.0/16) it rejects on the AWS console as invalid.

Scenario 2 : But if i run it as IAAC (Cloud formation) on a connected text editor, it corrects the mistake and works but the error remains in the CFN template

why?

I have screenshots incase this is needed.

Thank you

Ibukun
已提問 2 年前檢視次數 328 次
1 個回答
3

This is because CloudFormation corrects the VPC CIDR to its canonical form. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html

CidrBlock The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.

profile pictureAWS
專家
Matt-B
已回答 2 年前
profile pictureAWS
專家
已審閱 2 年前
  • This explains it quite well. Thank you very much.

  • Hello, does anyone has a human-readable reply? The answer is unclear to dummies like me and the URL quoted is not working. What is wrong with 10.0.0.0/16? How should it be written???

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南