DVA-C02 Deployment Practice Question
Which THREE actions are required to set up a blue/green deployment for an Amazon ECS service using AWS CodeDeploy? (Choose three.)
⚠ Common exam trap
The trap here is that candidates mistakenly think they need to create a second ECS service or a new ALB for the green environment, but CodeDeploy handles the green infrastructure automatically within the same service and ALB.
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
✓
Create an ECS application and deployment group in CodeDeploy.
CodeDeploy requires an ECS application and deployment group to manage the deployment lifecycle, including traffic shifting and rollback. The deployment group defines the ECS service, target groups, and load balancer listener for routing traffic between blue and green environments.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a second ECS service for the green environment.
Why it's wrong here
Creating a second, entirely new ECS service for the green environment is incorrect for blue/green deployments managed by CodeDeploy. Instead, CodeDeploy orchestrates the deployment by creating a new task set within the existing, single ECS service. This new task set represents the "green" version, allowing CodeDeploy to manage traffic routing between the original "blue" task set and the new "green" task set under the same service umbrella, without needing a separate service.
- ✓
Create an ECS application and deployment group in CodeDeploy.
Why this is correct
Establishing an ECS application and a deployment group within AWS CodeDeploy is a fundamental requirement. The CodeDeploy application acts as a logical container for deployments, while the deployment group specifies the target ECS service, the associated Application Load Balancer, and the listener configuration. This setup defines the specific deployment strategy, including how traffic will be shifted and any automated rollback triggers, making it essential for orchestrating the blue/green process.
- ✗
Create a new Application Load Balancer for the green environment.
Why it's wrong here
It is incorrect to create a new Application Load Balancer (ALB) specifically for the green environment. AWS CodeDeploy's blue/green deployment strategy for ECS services leverages the same existing ALB that serves the blue environment. CodeDeploy dynamically creates new target groups for the green task set and then reconfigures the ALB's listener rules to gradually or immediately shift traffic from the blue target group to the green target group, all within the single ALB.
- ✓
Specify the task definition and container images in the AppSpec file.
Why this is correct
Specifying the task definition and container images within the AppSpec.yaml file is absolutely critical for CodeDeploy. This file serves as the blueprint for the green environment, detailing the new ECS task definition ARN, the specific container name within that task definition, and the container port that the load balancer should target. Without this precise configuration, CodeDeploy would not know how to provision and configure the new green task set for deployment.
- ✓
Configure the ECS service to use the CodeDeploy deployment controller.
Why this is correct
Configuring the ECS service to utilize the CODE_DEPLOY deployment controller is a mandatory action to enable blue/green deployments. This setting explicitly instructs Amazon ECS to delegate all deployment management responsibilities, including task set creation, traffic shifting, and potential rollbacks, to AWS CodeDeploy. Without this integration, ECS would default to its rolling update deployment strategy, preventing CodeDeploy from orchestrating the sophisticated blue/green process.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 1,135 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 →
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.