DOP-C02 - SDLC Automation (22% of the exam) - Section 1.6

Implement deployment strategies for container workloads on Amazon ECS and Amazon EKS, including blue/green deployments with AWS CodeDeploy and rolling updates.

Apply blue/green deployments via AWS CodeDeploy and rolling update strategies for containerised workloads on Amazon ECS and Amazon EKS. Compare the traffic-shifting controls available in each strategy and choose the one that minimises downtime risk for a given release.

Amazon ECSAmazon EKSBlue/green deploymentRolling update

Practice question for this objective

Free sampleSDLC Automationhard

A payments team runs a containerised service as an Amazon ECS service on AWS Fargate behind an Application Load Balancer. Releases currently use the default rolling update, and a recent bad image briefly served errors to live users before tasks were replaced. The team now wants each release to stand up the new task set in full, expose it on a separate test listener so an automated suite can validate it, and shift production traffic across only after validation passes, with an instant reroute back to the old task set if anything fails. Which deployment approach MOST directly meets this requirement?

  • AKeep the ECS rolling update controller but lower the minimum healthy percent so fewer new tasks start at once, then add a container health check that fails fast when the new image misbehaves under live traffic.
  • BKeep the ECS rolling update controller and add a CodeDeploy in-place hook that runs the validation suite against each replacement task before it joins the target group, failing the deployment if a check fails.
  • CKeep the ECS rolling update controller but raise the maximum percent to 200 so a full second set of tasks starts before any old task stops, giving a parallel fleet that the load balancer validates before cutover.
  • DSwitch the ECS service to the CodeDeploy deployment controller so a blue/green deployment creates a replacement task set, registers it behind a test listener for automated validation, then shifts the production listener to it with one-click rollback. Correct
Choose the ECS CodeDeploy deployment controller for blue/green when a release must validate a parallel task set on a test listener before shifting production traffic. An Amazon ECS service using the CodeDeploy deployment controller provisions a replacement (green) task set, registers it on a separate test listener so validation hooks run before any production traffic moves, then shifts the production listener and retains the blue task set so rollback is an immediate listener reroute rather than redeploying replacement tasks.

Why A is wrong: Tuning rolling update percentages slows the replacement and isolates failures a little, but new tasks still take live production traffic during the rollout, so there is no separate test listener and no instant reroute to a preserved old task set.

Why B is wrong: CodeDeploy in-place deployments target EC2 and on-premises hosts, not ECS task sets, so this mixes an EC2 model into an ECS service and still validates tasks only as they enter the live production target group.

Why C is wrong: A maximum percent of 200 doubles task count during the rollout but both task sets share the same production target group, so there is no isolated test listener and no clean reroute back to the original tasks.

Why D is correct: The CodeDeploy deployment controller for ECS builds a green task set, exposes it on a test listener for validation hooks, and only then shifts the production listener, keeping the blue task set for an instant reroute on failure.

See more DOP-C02 practice questions, answers explained.

Exam traps in SDLC Automation

Answers that look right on this material and are not. Each one is a distractor from a different question in the DOP-C02 bank for this domain.

  • Add a SucceedDeployment lifecycle hook that runs a Lambda function which queries CloudWatch metrics after each traffic shift and calls StopDeployment with rollback enabled when the error metric is too high.

    Why it is wrong: A custom lifecycle-hook Lambda polling metrics duplicates a built-in feature and adds code to maintain, and SucceedDeployment is not the hook for ongoing monitoring, so this is more brittle than the native alarm integration.

  • Configure the ECS deployment controller type so the ECS rolling update scheduler manages replacements in place, then attach CodeDeploy afterwards to layer blue/green traffic shifting onto the same service.

    Why it is wrong: The ECS controller type drives rolling updates only and cannot be combined after the fact with CodeDeploy on the same service, so this does not produce the blue/green green-task-set model the engineer needs.

  • Create a CloudWatch Events rule that watches ECS task state-change events and triggers a Lambda function which calls UpdateService to roll the service back to the previous task definition when failures are detected.

    Why it is wrong: A custom CloudWatch Events rule and Lambda rollback works but is bespoke automation the team must build and maintain, which is more operational overhead than the native ECS feature designed for exactly this case.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.