DOP-C02 Configuration Management and IaC Practice Question
A DevOps engineer is designing a CI/CD pipeline for a containerized application using AWS CodePipeline and Amazon ECS. The pipeline should build a Docker image, push it to Amazon ECR, and deploy it to an ECS service. Which deployment action should they use in the pipeline?
⚠ Common exam trap
Many exam-takers confuse the ECS (Blue/Green) deployment provider with a simple 'update-service' command, not realizing that CodePipeline requires a native deployment provider to support automated traffic shifting, rollback, and integration with CodeDeploy's lifecycle hooks.
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
✓
Amazon ECS (Blue/Green) deployment provider with CodeDeploy.
Amazon ECS (Blue/Green) deployment provider with CodeDeploy is the native, fully managed deployment action in AWS CodePipeline for ECS services. It orchestrates traffic shifting, task set management, and rollback automatically using CodeDeploy's ECS blue/green deployment type, which is the recommended approach for containerized applications on ECS.
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 Elastic Beanstalk deployment action.
Why it's wrong here
An Elastic Beanstalk deployment action in AWS CodePipeline is designed to deploy applications to an AWS Elastic Beanstalk environment, which is a distinct PaaS compute service rather than Amazon ECS. Even when Elastic Beanstalk runs Docker containers, it manages its own platform, health checks, and capacity, and it does not interact with ECS services or task definitions. Using this action for an ECS workload would target the wrong service entirely, so it cannot perform an ECS deployment and is incorrect for this pipeline.
- ✗
AWS CodeBuild with a buildspec that runs aws ecs update-service.
Why it's wrong here
While AWS CodeBuild can run any shell command, including aws ecs update-service, this is a procedural script, not a native CodePipeline deployment action. CodeBuild would require manual handling of task definition revisions, container image updates, and deployment state, and it lacks the integrated traffic shifting, health check validation, and automatic rollback capabilities that a managed deployment provider provides. This approach is essentially a custom workaround and does not meet the requirement for a CI/CD pipeline that natively deploys ECS with controlled rollouts.
- ✓
Amazon ECS (Blue/Green) deployment provider with CodeDeploy.
Why this is correct
Amazon ECS (Blue/Green) with CodeDeploy is the correct native deployment provider for ECS in CodePipeline. CodeDeploy's ECS compute platform orchestrates the creation of a green task set, shifts traffic from the blue target group to the green target group in either linear or canary increments, and performs post-traffic-shift validation hooks defined in an AppSpec file. It also supports automatic rollback if the deployment fails health checks, making it the ideal, fully integrated choice for ECS blue/green deployments in a pipeline.
- ✗
AWS CloudFormation deployment action to update the ECS service.
Why it's wrong here
A CloudFormation deployment action in CodePipeline is used to create or update CloudFormation stacks, which is an infrastructure-as-code approach rather than an application deployment action for ECS services. Although you could update an ECS service through CloudFormation, this would be a full stack update that does not provide the fine-grained traffic shifting, validation hooks, or automatic rollback of a blue/green deployment. The pipeline would not natively orchestrate the ECS deployment lifecycle; instead, it would just modify resources, so this is not a direct deployment provider for ECS workloads.
Go deeper
Related to this question
About these practice questions
One of 1,298 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 →
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.