An instance in a public subnet is stopped and later started again. Before stopping it, the engineer wants its public-facing address to remain identical after the restart. Which approach guarantees this?
- Rely on the automatically assigned public IP, since AWS never changes it
- Associate an Elastic IP address with the instance before stopping it
- Add a static route in the route table for the instance's current public IP
- Enable "Auto-assign Public IP" on the subnet
Correct answer: B. Associate an Elastic IP address with the instance before stopping it
Only an Elastic IP is a fixed, account-owned address that stays associated with an instance (or its network interface) across stop/start cycles until it is explicitly disassociated or released. The automatically assigned public IP in option A is released back to the AWS pool whenever the instance stops, and a new one is drawn on start, so it is not stable — that false assumption is the flaw in A. Option C is invalid because route tables direct traffic by destination CIDR at the VPC networking layer; they have no mechanism to reserve a public IP for a specific instance. Option D only controls whether a newly launched instance in that subnet receives an auto-assigned public IP at all, and that address remains just as ephemeral as in option A, so it does not solve the persistence problem the engineer needs solved.
Source: AWS EC2 docs: Elastic IP addresses