A video streaming service runs its recommendations API as an Amazon ECS service on AWS Fargate, behind an Application Load Balancer. The team deploys the service with the default rolling update.
Last month a faulty image passed its health checks in the first minutes and then failed under load, and the rolling update had replaced most tasks before the alarms fired. The team wants a new version to receive live traffic first from a small share of users, to be shifted fully only if the alarms stay quiet for 10 minutes.
Any alarm on the 5xx error rate must return traffic to the previous version immediately, without a manual step.
Which deployment approach meets these requirements?
Choose one answer.
AA. Keep the rolling update and turn on the deployment circuit breaker with rollback, so that a deployment rolls back when tasks repeatedly fail to become healthy during the update.
BB. Switch the ECS service to the EXTERNAL deployment controller and shift listener weights with a script that adds 10 percent every minute, while an engineer watches the dashboard.
CC. Create a second ECS service with the new version, point a Route 53 weighted record at each service, and delete the old service once the change is complete.
DD. Use a CodeDeploy blue/green deployment for ECS with a canary traffic shift, and a CloudWatch alarm on 5xx errors that triggers automatic rollback.
B. Wrong: A script can shift weights, but the team would need to build its own rollback and alarm logic. An engineer watching a dashboard is too slow to meet the requirement for an immediate, automatic rollback.
C. Wrong: DNS weights are cached by clients and resolvers, so the shift is neither precise nor immediate. A rollback would wait for caches to expire, which fails the requirement to return traffic at once. Learn more: Configuring DNS failover (opens in a new tab)
D. Right: Correct. CodeDeploy starts a replacement task set, shifts a small share of listener traffic to it, waits the canary period, and then completes the shift. A CloudWatch alarm on 5xx errors can roll traffic back to the original task set automatically. Learn more: CodeDeploy blue/green deployments for Amazon ECS (opens in a new tab)
Explanation
CodeDeploy blue/green deployments for Amazon ECS run a replacement task set, shift listener traffic in stages and roll back when CloudWatch alarms fire. A canary configuration sends a small share first and the rest after a wait, which matches the requirement. The rolling update's circuit breaker reacts to failed tasks, and DNS weights and manual shifting cannot roll back quickly.
CodeDeploy starts a replacement task set, shifts a canary share of traffic to it, and rolls back on the 5xx alarm.
Want more on Deployments for ECS and EKS? The 5 full-length practice sets have 8 more Deployments for ECS and EKS questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →