ExitAWS CodeDeploy: ECS blue/green deployments1 / 9
Explanation

Two task sets, one deployment coordinator

How CodeDeploy coordinates replacement ECS task sets and load balancer traffic, including validation gates and failed traffic shifts. · advanced

For an ECS service using the CODE_DEPLOY deployment controller, CodeDeploy coordinates a replacement task set and load balancer routing instead of updating the original tasks in place. The ECS AppSpec identifies the replacement task definition and the container name and port used for load balancing; the deployment group identifies the service, target-group pair, and listeners.

The diagram uses an Application Load Balancer with a production listener and an optional test listener. Each task set uses a different target group. Production traffic initially reaches blue; test traffic can reach green before production moves. These are listener-routing changes, not Route 53 DNS changes or App Mesh routing changes.

The arrows show deployment control, application requests, and validation feedback—not every network connection. ECS AppSpec validation hooks name Lambda functions, not CodeBuild projects or Step Functions state machines. CodeDeploy owns this task-set and traffic lifecycle; a release pipeline can invoke it but does not replace that coordinator.

task-set creationeventual terminationrouting updatesoriginal requestsreplacement requestshook invocationtest requestshook statusalarm state
AWS CodeDeployECS deployment coordinator
Amazon Elastic Container Service (Amazon ECS)Replacement task set — green
Amazon Elastic Container Service (Amazon ECS)Original task set — blue
Elastic Load Balancing (ELB)ALB: production listener, test listener, two target groups
AWS LambdaAppSpec validation hooks
Amazon CloudWatchDeployment alarm monitoring

1 / 7 CodeDeploy coordinates this deployment using the ECS deployment group's configuration and the revision's AppSpec.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.