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

Design a zero-downtime blue/green for a monolith on EC2 behind an ALB.

AdvancedScenarioEC2, Auto Scaling and Load Balancing
Answer

Situation read → Two environments, one listener, weighted shift with fast rollback.

What I'd do →

  1. Create blue and green ASGs, each with its own target group
  2. Deploy the new AMI to green and run smoke tests against a test listener on port 8443
  3. Shift listener weights 10, 50, 100 percent with alarms on 5xx and latency
  4. Keep blue running for 30 minutes then scale to zero
  5. Roll back by flipping weights back: aws elbv2 modify-listener --listener-arn ... --default-actions ...

Why → Rollback is a weight change, not a redeploy, so recovery takes seconds.

Interview tip → Mention database migrations must be backward compatible for this to work.

aws All AWS questions Roadmap: AWS core services

More on EC2, Auto Scaling and Load Balancing