Interview Prep/AWS/EC2, Auto Scaling and Load Balancing

A stopped-and-started EC2 instance changed its public IP and broke the DNS record. How do you prevent that?

BeginnerScenarioEC2, Auto Scaling and Load Balancing
Answer

Situation read → Auto-assigned public IPs are released on stop.

What I'd do →

  1. Put a load balancer in front and point DNS at it
  2. Or associate an Elastic IP
  3. Or use a Route 53 alias to the ALB
  4. Avoid pointing DNS at instance IPs

Why → Load balancer DNS names are stable endpoints that survive instance replacement.

Interview tip → Treat instances as cattle.

aws All AWS questions Roadmap: AWS core services

More on EC2, Auto Scaling and Load Balancing