DVA-C02 Deployment Practice Question
A development team wants to automate the deployment of a microservices application on Amazon ECS with Fargate. The team uses AWS CodePipeline for CI/CD. Each microservice has its own source repository and Dockerfile. The team wants to build Docker images, push them to Amazon ECR, and deploy them to ECS. Which approach minimizes manual effort and follows best practices?
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 AWS CodePipeline with a build stage in CodeBuild and a deploy stage that uses the ECS deploy provider.
AWS CodePipeline provides a fully automated CI/CD pipeline. With the ECS deploy provider, CodePipeline can update the ECS service with the new task definition directly, eliminating manual steps. Option A is incorrect because adding CodeDeploy for blue/green deployments introduces unnecessary complexity for a basic ECS deployment; the ECS deploy provider in CodePipeline handles it without additional services. Option B is incorrect because it requires manual triggering of CloudFormation updates, which does not achieve full automation. Option D is incorrect because it requires manual intervention to update the ECS service, contradicting the goal of minimizing manual effort.
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 AWS CodeDeploy to deploy to ECS with a blue/green deployment.
Why it's wrong here
CodeDeploy blue/green deployments target EC2/on-premises instances or ECS services configured with the CODE_DEPLOY controller, which requires extra setup (two target groups, an AppSpec file, listener rules). For a straightforward ECS Fargate rolling deployment, the native ECS deploy provider in CodePipeline is simpler and requires no additional CodeDeploy application or deployment group configuration.
- ✗
Use AWS CloudFormation to create the infrastructure and manually trigger updates.
Why it's wrong here
CloudFormation is excellent for provisioning the ECS cluster, task definitions, and services declaratively, but manually triggering stack updates after every code change defeats the goal of automation and introduces human delay and error into the release process, rather than a hands-off CI/CD flow.
- ✓
Use AWS CodePipeline with a build stage in CodeBuild and a deploy stage that uses the ECS deploy provider.
Why this is correct
CodePipeline can orchestrate source, a CodeBuild stage that builds the Docker image and pushes it to ECR (producing an imagedefinitions.json artifact), and a deploy stage using the built-in Amazon ECS deploy action provider, which updates the task definition and service automatically on every commit with no manual steps.
- ✗
Use AWS CodeBuild to build and push images, then manually update the ECS service.
Why it's wrong here
CodeBuild can build and push images to ECR as part of a build stage, but manually updating the ECS service afterward reintroduces a manual, error-prone step into the pipeline, which does not satisfy the requirement to minimize manual effort and fully automate deployment.
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 1,135-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 DVA-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 team is deploying a containerized application on Amazon ECS using Fargate. The application requires high availability and must be deployed across multiple Availability Zones. The team wants to automate the deployment process using AWS CodePipeline. What is the most efficient way to update the ECS service with a new task definition?
medium- ✓ A.Use the ECS deploy action in CodePipeline with the 'Immediate' deployment option to update the service.
- B.Use an AWS Lambda function that calls the ECS UpdateService API with the new task definition.
- C.Use the AWS Management Console to update the ECS service with the new task definition.
- D.Use AWS CloudFormation to update the ECS service by updating the stack with the new task definition.
Why A: CodePipeline's ECS deploy action with the 'Immediate' deployment option automates updating the ECS service to use a new task definition, efficiently handling rolling updates across Availability Zones. Option B is wrong because using a Lambda function to call UpdateService adds complexity and is less efficient than the built-in CodePipeline action. Option C is wrong because manual console updates are not automated. Option D is wrong because CloudFormation is more suitable for infrastructure provisioning than frequent task definition updates for ECS services.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-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 DVA-C02 exam.