Question 545 of 724
DVA-C02 Deployment Practice Question
A developer is using AWS Elastic Beanstalk to deploy a web application. The application uses an Amazon RDS database instance that is included in the Elastic Beanstalk environment. The developer wants to update the application code without affecting the database. What is the recommended approach?
⚠ Common exam trap
Many candidates assume swapping CNAMEs between environments (blue/green deployment) is sufficient to protect the database, but they overlook that the database is still lifecycle-managed within each environment and will be lost if the original environment is terminated.
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
✓
Decouple the database from the Elastic Beanstalk environment by creating a separate RDS instance and connecting the application to it externally.
When an RDS instance is included in an Elastic Beanstalk environment, it is tied to the environment's lifecycle. If the environment is terminated or rebuilt, the database is also deleted. Decoupling the database by creating a standalone RDS instance and connecting the application to it externally ensures the database persists independently of application deployments, allowing code updates without risking data loss.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Update the application code directly on the EC2 instances without redeploying the environment.
Why it's wrong here
Directly modifying EC2 instances bypasses Elastic Beanstalk's management layer, leading to configuration drift where the actual state diverges from the desired state defined in the environment configuration. This makes the environment non-reproducible, complicates troubleshooting, and prevents Elastic Beanstalk from properly managing updates or scaling, violating the principles of immutable infrastructure.
- ✗
Create a new environment configuration, update the code, and swap the CNAME of the environments.
Why it's wrong here
While a CNAME swap facilitates a zero-downtime application deployment by redirecting traffic to a new, pre-warmed environment, it does not isolate the database if it was provisioned as part of the Elastic Beanstalk environment. Any changes to the new environment's configuration, or even a rebuild, could still impact or destroy the attached database, making it unsuitable for protecting persistent data during environment updates.
- ✓
Decouple the database from the Elastic Beanstalk environment by creating a separate RDS instance and connecting the application to it externally.
Why this is correct
Decoupling the database by provisioning a standalone Amazon RDS instance outside the Elastic Beanstalk environment ensures its independent lifecycle management, allowing for separate scaling, backups, and patching. The application then connects to this external database using environment properties, guaranteeing data persistence and availability even if the Elastic Beanstalk environment is rebuilt, terminated, or updated, which is critical for production workloads.
- ✗
Use Elastic Beanstalk's platform updates while keeping the database attached to the environment.
Why it's wrong here
Elastic Beanstalk platform updates, whether in-place or immutable, apply changes across the entire environment, including any database instance provisioned *within* that environment. Keeping the database attached means it is subject to these updates, potentially causing downtime, data loss, or requiring a full rebuild of the database instance, which is generally unacceptable for production databases.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.