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
Creating a second environment and swapping URLs uses Elastic Beanstalk's CNAME swap, which redirects traffic at the DNS level once the new version passes health checks. This satisfies the minimal-downtime constraint, since the original environment keeps serving until the swap completes, enabling instant rollback by swapping back.
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 →
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: Elastic Beanstalk blue/green deployment requires creating a completely new environment rather than updating the existing one, so option E (deploy the new application version to a separate Elastic Beanstalk environment) is correct because the new version must run in its own environment alongside the original. Option B (swap the CNAMEs of the two environments) is correct because Elastic Beanstalk's Swap Environment URLs feature exchanges the CNAMEs so that the environment URL users already use now resolves to the new environment, redirecting traffic without DNS changes. Option C (terminate the old environment after verifying the new environment) is correct because once the swap is validated and the new environment is healthy, the original environment is no longer needed and should be terminated to avoid unnecessary resource charges. Option A is incorrect because updating the existing environment in place is a rolling/all-at-once deployment, not blue/green, and would not provide an instant rollback path. Option D is incorrect because Elastic Beanstalk blue/green uses the built-in CNAME swap rather than manually editing a Route 53 DNS record.
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.