Blue/Green Deployment in AWS Elastic Beanstalk
A development team uses AWS Elastic Beanstalk to deploy a web application. They want to perform a blue/green deployment to minimize downtime. What should they do to implement this?
Quick Answer
The answer is to create a new environment, deploy the new version, and then swap the environment URLs. This is correct because blue/green deployment in AWS Elastic Beanstalk relies on swapping the CNAME records between two separate environments, instantly routing all traffic from the old blue environment to the new green one with zero downtime. On the AWS Certified Developer Associate DVA-C02 exam, this concept tests your understanding of minimizing deployment risk and enabling instant rollback, often appearing as a distractor against rolling or immutable deployments. A common trap is confusing URL swapping with updating the existing environment’s configuration, which would cause downtime. Remember the key: blue/green is about swapping, not updating. A useful memory tip is “Swap to stop, swap to start”—the URL swap halts traffic to blue and starts it on green instantly.
⚠ Common exam trap
Watch out — candidates often confuse the built-in Elastic Beanstalk blue/green deployment (environment swap) with the deployment policies (e.g., Rolling, Immutable) that operate within a single environment, or they incorrectly assume CodeDeploy is the only way to perform blue/green deployments.
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 a new environment, deploy the new version, and then swap the environment URLs.
Blue/green deployment in Elastic Beanstalk is achieved by creating a separate environment (the green environment) with the new application version, then swapping the CNAME records (URLs) of the two environments. This instantly routes traffic from the old (blue) environment to the new (green) environment with zero downtime, and allows quick rollback by swapping back.
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 an Auto Scaling group and manually replace instances.
Why it's wrong here
This is not an automated blue/green deployment.
- ✗
Update the existing environment with the new version and set the deployment policy to 'Rolling'.
Why it's wrong here
This is a rolling update, not blue/green.
- ✗
Use AWS CodeDeploy to perform a blue/green deployment on the EC2 instances.
Why it's wrong here
Elastic Beanstalk manages deployments internally; CodeDeploy is not required.
- ✓
Create a new environment, deploy the new version, and then swap the environment URLs.
Why this is correct
This is the standard blue/green deployment in Elastic Beanstalk.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 724 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 →
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 developer is using AWS Elastic Beanstalk to deploy a web application. The environment uses an Application Load Balancer (ALB). The developer wants to perform a blue/green deployment to minimize downtime. Which TWO steps should the developer take? (Choose two.)
easy- A.Terminate the old environment after the new environment is deployed.
- B.Add more EC2 instances to the existing environment.
- ✓ C.Deploy the new version to a separate Elastic Beanstalk environment.
- D.Update the existing environment with the new version.
- ✓ E.Swap the CNAME records of the two environments.
Why C: Blue/green deployment requires a separate, isolated environment running the new version. Elastic Beanstalk supports this by allowing you to create a second environment (green) alongside the existing one (blue), ensuring zero overlap and no risk to the live application during deployment.
Variation 2. A development team is using AWS Elastic Beanstalk to deploy a web application. The team wants to perform a blue/green deployment. Which THREE steps are required to complete the blue/green deployment?
easy- A.Update the existing environment with the new version.
- ✓ B.Swap the CNAMEs of the two environments.
- ✓ C.Terminate the old environment after verifying the new environment.
- D.Update the Route 53 DNS record to point to the new environment.
- ✓ E.Deploy the new application version to a separate Elastic Beanstalk environment.
Why B: In a blue/green deployment with Elastic Beanstalk, you first deploy the new application version to a separate environment (E). Then, you swap the CNAMEs of the two environments to route traffic to the new environment (B). After verifying the new environment works correctly, you terminate the old environment (C). Option A is incorrect because you do not update the existing environment; you create a new one. Option D is incorrect because you swap CNAMEs, not manually update Route 53 DNS records.
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.