DVA-C02 Development with AWS Services Practice Question
A company has a microservices architecture running on Amazon ECS with Fargate. Each service exposes an API through an Application Load Balancer (ALB). The development team needs to implement canary deployments for one of the services. What is the MOST efficient way to achieve this?
⚠ Common exam trap
Candidates often think that because ALB supports weighted target groups, they should configure them manually for ECS canary deployments. However, for ECS, AWS CodeDeploy is the standard and most efficient tool to automate canary traffic shifting using those target groups.
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 CodeDeploy with an ECS blue/green deployment configuration that supports canary traffic shifting.
AWS CodeDeploy natively supports blue/green and canary deployments (e.g., ECSCanary10Percent5Minutes) for Amazon ECS. While ALB weighted target groups and ECS Task Sets are the underlying mechanisms used during these deployments, managing them manually (Option C) requires using the EXTERNAL deployment controller and writing custom orchestration code, which is highly inefficient. CodeDeploy automates this entire process seamlessly.
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 two ECS services behind the same ALB, each with a different task definition, and use sticky sessions.
Why it's wrong here
Creating two distinct ECS services, each representing a different application version, behind a single ALB is a valid setup for A/B testing or blue/green. However, enabling sticky sessions (session affinity) on the ALB listener or target group would bind a user's subsequent requests to the initial target, preventing dynamic traffic shifting for canary deployments. This means once a user hits the new version, they will remain on it, making it impossible to gradually roll back or increase traffic based on real-time metrics for all users.
- ✗
Use Amazon Route 53 weighted routing policies to distribute traffic between two ALBs.
Why it's wrong here
While Route 53 weighted routing can distribute traffic between different endpoints, such as two ALBs, it operates at the DNS level. DNS caching by clients and recursive resolvers means changes to weights can take minutes or even hours to propagate globally, making it unsuitable for real-time, granular traffic shifting required for canary deployments. This approach also introduces additional infrastructure complexity and potential latency compared to managing traffic at the ALB layer.
- ✗
Configure the ALB to use weighted target groups, each pointing to a different task set of the same ECS service.
Why it's wrong here
This is the most effective and direct method for implementing canary deployments with ECS. An Application Load Balancer (ALB) can be configured with a listener rule that forwards traffic to multiple target groups, each assigned a specific weight. In ECS, a service can have multiple task sets, representing different deployment versions. By associating each task set with a distinct target group and then adjusting the weights on the ALB listener rule, traffic can be precisely and gradually shifted between the old and new versions in real-time without DNS propagation delays.
- ✓
Use AWS CodeDeploy with an ECS blue/green deployment configuration that supports canary traffic shifting.
Why this is correct
AWS CodeDeploy does support blue/green deployments for ECS, including advanced traffic shifting strategies like canary. However, for a scenario focused purely on gradual traffic shifting between two versions of an application within the same ECS service, directly configuring weighted target groups on the ALB is a simpler and more native approach. CodeDeploy introduces an orchestration layer that, while powerful for complex deployment pipelines, might be overkill when the ALB's built-in capabilities can achieve the desired canary deployment with less overhead.
Go deeper
Related to this question
About these practice questions
One of 1,135 original DVA-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 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.