AWS Certified SysOps Administrator – Associate (legacy) — Question 295

A user has created a public subnet with VPC and launched an EC2 instance within it. The user is trying to delete the subnet. What will happen in this scenario?

Answer options

Correct answer: B

Explanation

In AWS, you cannot delete a subnet that contains active resources, including running or stopped EC2 instances. The user must first terminate any EC2 instances residing in the subnet before AWS will allow the subnet to be deleted. Options A, C, and D are incorrect because AWS does not automatically migrate or terminate instances upon subnet deletion, nor does it require deleting the entire VPC first.