AWS Certified Advanced Networking - Specialty: Understanding VPC and Subnet Termination

What happens when instances are terminated in a VPC's public subnet?

Prev Question Next Question

Question

A user has created a VPC with a public subnet.

The user has terminated all the instances which are part of the subnet.

Which of the below mentioned statements is true with respect to this scenario?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - B.

When you delete an instance the elastic network interface which in the below example of eth0 will also be deleted.

For information on elastic network interfaces , please visit the link:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html

The correct answer to this question is: D. The subnet to which the instances were launched with will be deleted.

When a subnet is created in a VPC, it is associated with a specific availability zone within the region in which the VPC is created. The subnet exists within the VPC's IP address range, and instances launched in the subnet are assigned private IP addresses from this range.

If all instances within a subnet are terminated, the subnet is no longer needed and can be deleted. This is because the subnet does not exist independently of the instances; it is simply a container for them. Deleting the subnet will remove all associated resources, including any network interfaces attached to the instances within the subnet.

Option A is incorrect because a VPC can be deleted even if subnets are present within it. The user may not be able to delete a subnet if it has dependent resources such as route tables, network ACLs or security groups.

Option B is incorrect because network interfaces are attached to instances, not to subnets. When an instance is terminated, all associated network interfaces are also terminated.

Option C is incorrect because a new instance can be launched in the same subnet after the original instances have been terminated, as long as the subnet still exists.