Courseiva
SDLC AutomationhardMultiple ChoiceObjective-mapped

DOP-C02 SDLC Automation Practice Question

An organization uses AWS CodePipeline with multiple stages: Source, Build, Deploy to Test, Deploy to Prod. They want to implement a canary deployment strategy for the production deployment. Which approach should they use?

⚠ Common exam trap

Many exam-takers confuse traffic routing mechanisms (like ELB weighted target groups) with deployment strategies (like CodeDeploy canary), failing to recognize that CodeDeploy provides the orchestration, lifecycle hooks, and automated rollback that a true canary deployment requires.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use CodeDeploy with a canary deployment configuration in the Deploy to Prod stage.

AWS CodePipeline integrates natively with CodeDeploy, which supports canary deployments by shifting a percentage of traffic to the new revision over a specified time interval (e.g., 10% every 5 minutes). Using CodeDeploy with a canary configuration in the Deploy to Prod stage directly implements the desired canary strategy within the pipeline, leveraging CodeDeploy's built-in traffic shifting and health monitoring.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use a Lambda function in CodePipeline to manually adjust weights in Route53.

    Why it's wrong here

    This approach would require you to write and maintain a custom Lambda function that manipulates Route 53 weighted DNS records, effectively hand-rolling a traffic-shifting engine. It bypasses CodeDeploy's native deployment lifecycle, so you lose automatic health checks, failure detection, and rollback capabilities. CodePipeline's Lambda invocation can trigger the function, but it is purely a custom workaround and not a managed deployment strategy — it's complex, error-prone, and outside the recommended deployment pattern.

  • Use CodeDeploy with a canary deployment configuration in the Deploy to Prod stage.

    Why this is correct

    CodeDeploy is the AWS-native service designed for controlled software rollouts, and its canary deployment configuration is fully supported as a CodePipeline deploy action. For example, a configuration like Canary10Percent5Minutes shifts 10% of traffic to the new task set or instance fleet, waits five minutes, then shifts the remaining 90%, while monitoring health via lifecycle hooks. Because CodeDeploy owns the traffic-shifting logic, it automatically detects failures, stops the deployment, and can roll back to the previous version. This directly satisfies the requirement for a built-in canary strategy in the Deploy to Prod stage with no custom scripting.

  • Use an Elastic Load Balancer to gradually shift traffic using weighted target groups.

    Why it's wrong here

    An Elastic Load Balancer can distribute traffic to multiple target groups, and you could theoretically alter the weights to inch traffic from an old fleet to a new one, but this is a purely manual, infrastructure-level control plane operation. The ELB itself has no knowledge of the application version, does not perform health checks tied to the deployment, and provides no integration with CodePipeline actions. You would have to orchestrate the weight changes with external automation, manage drift, and handle rollbacks yourself — it is not a CI/CD deployment mechanism and is totally disconnected from the pipeline's progress or validation gates.

  • Use CloudFormation with a canary update policy in the Deploy to Prod stage.

    Why it's wrong here

    CloudFormation's UpdatePolicy does provide a RollingUpdate strategy for Auto Scaling groups, but that is not the same as a canary deployment, and for Lambda there is no native canary update policy at all. To get canary-like behavior from CloudFormation, you would have to rely on a custom resource or trigger a CodeDeploy deployment from within a nested stack, which is indirect and redundant. CloudFormation is intended for infrastructure provisioning, not live traffic shifting between application versions, so using it in the Deploy to Prod stage would not give you the controlled percentage-based rollout the question asks for.

About these practice questions

One of 1,487 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.