Interview Prep/CI/CD/Release Engineering and Progressive Delivery

How do you do a blue-green deployment with AWS ALB and ECS or EKS?

IntermediateProductionRelease Engineering and Progressive Delivery
Answer

Create two target groups (blue, green) behind one ALB listener. Deploy the new version into the idle target group, run tests against its test listener port, then shift the listener's weighted forwarding from 100/0 to 0/100 (or in steps). ECS has native blue/green via CodeDeploy, and since 2025 built-in ECS blue/green deployments. Keep blue running for a bake period for instant rollback.

aws elbv2 modify-listener --listener-arn $LISTENER_ARN --default-actions \
 '[{"Type":"forward","ForwardConfig":{"TargetGroups":[
   {"TargetGroupArn":"'$GREEN_TG'","Weight":100},
   {"TargetGroupArn":"'$BLUE_TG'","Weight":0}]}}]'
All CI/CD questions Roadmap: CI/CD fundamentals

More on Release Engineering and Progressive Delivery