Question 1,257 of 724
DVA-C02 Elastic Beanstalk-managed RDS Practice Question
A developer is using AWS Elastic Beanstalk to deploy a web application. The application requires a relational database. The developer wants to ensure that the database is not accidentally deleted when the Elastic Beanstalk environment is terminated. Which approach should the developer take?
⚠ Common exam trap
Candidates often assume that adding a retention policy (Option D) is possible within Elastic Beanstalk, but Elastic Beanstalk does not expose a retention policy for RDS instances created as part of the environment; the database is always deleted with the environment unless it is created externally.
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 the RDS instance outside of Elastic Beanstalk and configure the application to connect to it using environment variables.
Creating the RDS instance outside of Elastic Beanstalk decouples the database lifecycle from the environment lifecycle. When the Elastic Beanstalk environment is terminated, the external RDS instance remains intact and is not deleted. The application can connect to it using environment variables configured in the Elastic Beanstalk environment, ensuring persistence of data.
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 the database as part of the Elastic Beanstalk environment by adding an RDS database configuration in the .ebextensions.
Why it's wrong here
This ties the database to the environment, and it will be deleted when the environment is terminated.
- ✓
Create the RDS instance outside of Elastic Beanstalk and configure the application to connect to it using environment variables.
Why this is correct
The database is independent of the environment lifecycle, so it will not be deleted when the environment is terminated.
- ✗
Use an Amazon DynamoDB table instead of a relational database.
Why it's wrong here
DynamoDB is NoSQL; the application requires a relational database.
- ✗
Configure a retention policy on the RDS instance within the Elastic Beanstalk environment.
Why it's wrong here
Elastic Beanstalk does not support retention policies for in-environment RDS instances; they are always deleted on termination.
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 →
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 application uses an in-environment Amazon RDS database instance. The developer needs to update the application code without risking data loss. The database must not be affected by environment operations such as termination or updates. What is the recommended approach?
medium- ✓ A.Create a standalone Amazon RDS instance and reconfigure the application to use it instead of the in-environment database.
- B.Take a snapshot of the database before each deployment and restore it after the deployment completes.
- C.Use the Elastic Beanstalk environment's 'Swap environment URLs' feature to perform a blue/green deployment.
- D.Create a new Elastic Beanstalk environment with a new RDS instance and migrate data manually.
Why A: Decoupling the RDS database from the Elastic Beanstalk environment by creating a standalone RDS instance ensures that the database is not tied to the environment's lifecycle. In-environment databases are automatically deleted when the environment is terminated or updated, risking data loss. By reconfiguring the application to point to an external RDS instance, the database persists independently of environment operations, meeting the requirement to avoid data loss during code updates or environment changes.
Variation 2. 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?
medium- A.Update the application code directly on the EC2 instances without redeploying the environment.
- B.Create a new environment configuration, update the code, and swap the CNAME of the environments.
- ✓ C.Decouple the database from the Elastic Beanstalk environment by creating a separate RDS instance and connecting the application to it externally.
- D.Use Elastic Beanstalk's platform updates while keeping the database attached to the environment.
Why C: 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.
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.