VPC/CIDR IPv4 issue


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 ( 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


I have screenshots incase this is needed.

Thank you

demandé il y a 2 ans352 vues
1 réponse

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, We modify the specified CIDR block to its canonical form; for example, if you specify, we modify it to

profile pictureAWS
répondu il y a 2 ans
profile pictureAWS
vérifié il y a 2 ans
  • 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 How should it be written???

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions