AWS Certified Advanced Networking - Specialty: CloudFormation Template for VPC with Two Subnets

Deploying a CloudFormation Template: VPC Creation with Two Subnets

Prev Question Next Question

Question

What would be the output when you deploy a CloudFormation template to create a VPC with two separate subnets in CIDR ranges of 10.0.0.0/16 and 10.0.1.0/24?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - C.

Here, since there are overlapping CIDR blocks, the template deployment will fail, and all resources will be rolled back.

Option A is invalid because if the JSON template is valid in the syntax, it will proceed ahead.

Option B is invalid because when an error occurs, all resources will be rolled back by default.

Option D is invalid because it will give an error because of overlapping CIDR blocks.

For more information on Cloudformation key concepts, please refer to the below URL:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html

The correct answer is D. The CloudFormation template will deploy successfully.

Explanation: When a CloudFormation template is used to create a VPC with two separate subnets in CIDR ranges of 10.0.0.0/16 and 10.0.1.0/24, the deployment will succeed because both subnets are within the same VPC range of 10.0.0.0/16.

CIDR (Classless Inter-Domain Routing) notation represents a range of IP addresses, where the address is followed by a forward slash and a number that indicates the size of the subnet. In this case, the VPC range is 10.0.0.0/16, which means that it can have up to 65,536 IP addresses. The first subnet is defined with the range of 10.0.0.0/16, which covers the entire VPC range. The second subnet is defined with the range of 10.0.1.0/24, which is a subset of the VPC range and can have up to 256 IP addresses.

In summary, since both subnets are within the same VPC range, the deployment will be successful without any errors.