Courseiva
SDLC Automation →mediumMultiple Select

DOP-C02 SDLC Automation Practice Question

Which TWO AWS services can be used to implement a blue/green deployment for an application running on Amazon EC2 instances?

⚠ Common exam trap

A common mix-up: candidates confuse AWS CloudFormation (which can define the infrastructure for blue/green deployments) with the actual deployment service that orchestrates the traffic shift, leading them to select CloudFormation instead of CodeDeploy or Elastic Beanstalk.

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

✓

AWS CodeDeploy

AWS CodeDeploy (Option B) is correct because it natively supports blue/green deployments for Amazon EC2 instances by allowing you to provision a new set of instances (the green environment), deploy the new application revision to them, and then shift traffic from the old (blue) environment to the new one. This is achieved through integration with an Elastic Load Balancer (ELB) or Auto Scaling groups, where CodeDeploy manages the lifecycle of instances and traffic routing during the deployment process.

Answer analysis

Option-by-option breakdown

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

  • ✗

    AWS CloudFormation

    Why it's wrong here

    AWS CloudFormation is an infrastructure-as-code service that provisions and manages AWS resources through templates. While it can create the EC2 instances or Auto Scaling groups used in a blue/green scenario, it does not inherently shift production traffic between two fixed environments or perform the routing swap itself. Achieving blue/green with CloudFormation would require custom UpdatePolicy hooks to CodeDeploy or manual stack updates, making it a supporting tool rather than the primary deployment orchestrator.

  • ✓

    AWS CodeDeploy

    Why this is correct

    AWS CodeDeploy is the correct choice because it provides a native blue/green deployment model for EC2/On-Premises and AWS Lambda workloads. During a blue/green deployment, CodeDeploy automatically provisions a new replacement fleet (green), registers it with the load balancer, and shifts traffic incrementally from the original fleet (blue) to the green fleet, with options for automatic rollback if deployment fails. Its built-in deployment lifecycle hooks and traffic-routing controls make it a fully managed service purpose-built for this strategy.

  • ✓

    AWS Elastic Beanstalk

    Why this is correct

    AWS Elastic Beanstalk supports blue/green deployments through its environment-swap feature: you deploy your new application version to a separate staging environment (green), then swap the CNAME of the blue environment with the green one to redirect production traffic instantly. This approach avoids downtime and allows quick rollback by swapping back if issues arise. Elastic Beanstalk is correct because it natively facilitates the environment-level traffic switch without requiring manual DNS or infrastructure reconfiguration.

  • ✗

    AWS OpsWorks

    Why it's wrong here

    AWS OpsWorks relies on Chef or Puppet for configuration management and supports rolling deployments by updating instances one at a time, but it lacks a native blue/green deployment mechanism. To implement blue/green with OpsWorks, you would need to manually create an entire second stack, re-run recipes, and then adjust routing—something OpsWorks does not orchestrate out of the box. Therefore, while it can manage existing instances, it is not tailored for the rapid environment swap required by blue/green.

  • ✗

    AWS CodeBuild

    Why it's wrong here

    AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces deployment artifacts. It has no functionality for deploying applications, managing server fleets, or shifting traffic between environments, so it could never handle blue/green staging and cutover. At most, it would be used in a pipeline to build a revision that a separate service like CodeDeploy or Elastic Beanstalk then deploys.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.