DVA-C02 Deployment Practice Question
Which TWO approaches can a developer use to automate the deployment of a microservices application to Amazon ECS with Fargate, ensuring that each microservice is independently deployable and can scale based on demand?
⚠ Common exam trap
Watch out — candidates often confuse 'multiple containers per task' (which still couples them) with 'separate services' (which decouples them), leading them to choose Option B as a valid approach for independent deployment.
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
✓
Define each microservice as a separate ECS service with its own task definition
Defining each microservice as a separate ECS service with its own task definition allows independent deployment, scaling, and lifecycle management. Each service can be updated, rolled back, or scaled based on its own demand without affecting other microservices, which aligns with microservices architecture principles.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Define all microservices in a single task definition and run them as one service
Why it's wrong here
Defining all microservices within a single ECS task definition couples their lifecycles and resource requirements. This approach forces all services to be deployed, scaled, and updated together, negating the core benefits of microservices such as independent scalability and fault isolation. A failure or update in one service would impact all others within the same task, increasing deployment risk and reducing agility.
- ✗
Use a single ECS service with multiple containers per task definition
Why it's wrong here
Utilizing a single ECS service with multiple containers per task definition means that the entire task, comprising all microservices, is scaled as a single unit. This prevents individual microservices from scaling independently based on their specific demand, leading to inefficient resource utilization and potential performance bottlenecks for services that require more or less capacity than others. The shared lifecycle within the task also complicates independent updates and rollbacks.
- ✗
Use a single CodePipeline that builds all microservices together
Why it's wrong here
A single CodePipeline that builds and deploys all microservices together creates a monolithic deployment pipeline, which directly contradicts the independent deployability principle of microservices. Any change, no matter how small, in a single microservice would necessitate rebuilding and redeploying the entire application, increasing deployment time, risk, and the complexity of rollbacks. This significantly hinders agility and continuous delivery for individual service teams.
- ✓
Define each microservice as a separate ECS service with its own task definition
Why this is correct
Defining each microservice as a separate ECS service, each with its own dedicated task definition, is the correct architectural pattern for microservices on ECS. This approach enables independent scaling, deployment, and lifecycle management for each individual service, allowing developers to update or scale a single microservice without affecting others. It ensures optimal resource allocation and fault isolation, aligning perfectly with microservice principles.
- ✓
Use a separate CodePipeline for each microservice that builds and deploys independently
Why this is correct
Implementing a separate CodePipeline for each microservice ensures true independent build, test, and deployment cycles, which is fundamental for agile microservice development. This allows teams to release updates for individual services rapidly and autonomously, without waiting for or impacting other services. Such decoupling minimizes deployment risk, accelerates time-to-market, and simplifies rollbacks for specific components, fostering continuous integration and continuous delivery.
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
2 more ways 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 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?
hard- A.Use AWS CodeDeploy to deploy to ECS with a blue/green deployment.
- B.Use AWS CloudFormation to create the infrastructure and manually trigger updates.
- ✓ C.Use AWS CodePipeline with a build stage in CodeBuild and a deploy stage that uses the ECS deploy provider.
- D.Use AWS CodeBuild to build and push images, then manually update the ECS service.
Why C: 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.
Variation 2. A company is deploying a microservices-based application on Amazon ECS using Fargate. The application consists of three services: frontend, backend, and database. The database service uses Amazon Aurora Serverless. The frontend and backend services are deployed as separate ECS services. The company uses AWS CodePipeline for CI/CD. Each service has its own CodePipeline pipeline that builds a Docker image and pushes it to Amazon ECR, then updates the ECS service with the new image. Recently, the backend service deployment started causing intermittent errors. After investigation, the developer found that the backend service is being updated while the frontend service is still pointing to the old backend version, causing API incompatibility. The developer needs to ensure that the backend service is updated before the frontend service, and that both are updated atomically. The developer also wants to automate the update process using CodePipeline. What should the developer do?
hard- A.Add a manual approval step between the backend and frontend pipelines.
- B.Create a single pipeline that deploys both services simultaneously by updating both ECS services in a single CodeDeploy deployment.
- C.Configure the frontend pipeline to trigger after the backend pipeline completes using Amazon CloudWatch Events.
- ✓ D.Create a single pipeline with separate stages: first deploy backend, then after successful deployment, deploy frontend.
Why D: A single CodePipeline with sequential stages (backend deploy stage followed by frontend deploy stage) enforces ordering and makes the release atomic from the pipeline's perspective — the frontend stage only runs after the backend stage succeeds. This directly addresses the API incompatibility caused by the frontend being updated while the backend is still on the old version. CodePipeline natively supports multiple deploy actions across stages, so no external orchestration is needed.
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.