DOP-C02 SDLC Automation Practice Question
A company wants to implement a CI/CD pipeline for an application that runs on Amazon ECS with Fargate. The pipeline should build a Docker image, push it to Amazon ECR, and deploy a new task definition to ECS. Which THREE AWS services are required to build this pipeline?
⚠ Common exam trap
Candidates often assume AWS CodeCommit is mandatory for source control in a CI/CD pipeline, but the pipeline can use any Git repository or S3 bucket as a source, making CodeCommit optional.
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 is required because it manages the deployment of the updated task definition to the ECS service, supporting strategies like blue/green and canary deployments. It integrates with AWS CodePipeline to orchestrate the deployment step, ensuring minimal downtime and rollback capabilities.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Amazon S3
Why it's wrong here
Amazon S3 is not a required component for this ECS-based CI/CD pipeline. Although S3 can serve as an artifact repository or a source code location, the pipeline described does not depend on it; artifacts can be passed directly from CodeBuild to CodeDeploy via CodePipeline. Since the objective is to build and deploy a containerized application to ECS, S3 plays no essential role and is therefore an incorrect choice.
- ✓
AWS CodeDeploy
Why this is correct
AWS CodeDeploy is the correct service for deploying the new task definition to Amazon ECS. It uses a blue/green deployment strategy when configured with the ECS deployment controller, allowing traffic to be shifted gradually from the old task set to the new one while monitoring health and supporting automatic rollbacks. CodeDeploy accepts a versioned task definition and an AppSpec file, making it the service that actually performs the deployment to ECS.
- ✓
AWS CodePipeline
Why this is correct
AWS CodePipeline is a fully managed continuous delivery service that orchestrates the entire CI/CD workflow, from source to build to deploy. It defines stages for source retrieval, image building, and deployment, and automatically passes artifacts between them. In this pipeline, CodePipeline coordinates the actions of CodeBuild and CodeDeploy, making it an essential orchestration layer even though it does not directly perform the build or deployment operations.
- ✗
AWS CodeCommit
Why it's wrong here
AWS CodeCommit is a managed Git-based source control service, but it is not mandatory for this CI/CD pipeline. CodePipeline can integrate with other source providers such as GitHub, Bitbucket, or even Amazon S3, so the company is not required to use CodeCommit. While CodeCommit could hold the application source, its absence does not block the pipeline, making it an incorrect answer when the requirement is only to implement CI/CD.
- ✓
AWS CodeBuild
Why this is correct
AWS CodeBuild is the correct choice for building the Docker image in this pipeline. It takes the source code from the source stage, executes the build commands in the buildspec file, and produces the container image artifact. CodeBuild also handles tasks like running tests and pushing the image to an Amazon ECR repository, so it is the service responsible for creating the deployable artifact that CodeDeploy later uses.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on DOP-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A DevOps team is implementing a CI/CD pipeline for a microservices application deployed on Amazon ECS. They want to automatically build, test, and deploy container images to Amazon ECR and then update the ECS service. Which TWO steps are essential to achieve this goal?
easy- ✓ A.Use AWS CodeDeploy to update the ECS service with a new task definition.
- B.Use AWS Secrets Manager to store Docker credentials.
- ✓ C.Use AWS CodeBuild to build the Docker image and push it to Amazon ECR.
- D.Use AWS X-Ray for tracing.
- E.Use Amazon CodeGuru for code review.
Why A: AWS CodeDeploy is the native AWS service for managing ECS rolling or blue/green deployments. It orchestrates the creation of a new ECS task definition, registers it, and updates the ECS service to use the new task definition, ensuring zero-downtime deployments. Option C is correct because AWS CodeBuild can execute build commands from a buildspec.yml file to build a Docker image and push it to Amazon ECR using the built-in AWS CLI or Docker commands, which is a fundamental step in a CI/CD pipeline for containerized applications.
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.