AWS Certified Advanced Networking – Specialty (ANS-C00) — Question 316
You have a web application (app.mycompany.com) running on an EC2 instance with a single elastic network interface in a subnet in a VPC. Because of a network redesign, you need to move the web application to a different subnet in the same Availability Zone.
Which of the following migration strategies meets the requirements?
Answer options
- A. Create an elastic network interface in the new subnet. Attach this interface to the instance, and detach the old interface.
- B. Launch a new instance in the subnet via an AMI created from the instance, and redirect new connections to this new instance using DNS. Decommission the old instance.
- C. Make an API call to change the subnet association of the elastic network interface.
- D. Change the IP addresses manually to another subnet within the server operating system.
Correct answer: B
Explanation
An EC2 instance and its primary elastic network interface (ENI) cannot be moved to a different subnet after creation, and you cannot modify the subnet association of an existing ENI. Therefore, the only viable method is to capture an AMI of the current instance, deploy a new instance from that AMI in the target subnet, and update the DNS record before decommissioning the old host. Attempting to manually alter IP settings inside the OS will result in a complete loss of network connectivity.