Question 1,257 of 1,616
DeploymentmediumMultiple ChoiceObjective-mapped

Quick Answer

The answer is to create the RDS instance outside of Elastic Beanstalk and configure the application to connect to it using environment variables. This approach is correct because it decouples the database lifecycle from the environment lifecycle; when you terminate the Elastic Beanstalk environment, the externally created RDS instance remains intact and is not deleted. On the AWS Certified Developer Associate DVA-C02 exam, this scenario tests your understanding of environment-independent resource management and the risk of tied lifecycles. A common trap is assuming that setting a deletion policy on an in-environment RDS instance will protect it, but Elastic Beanstalk does not honor CloudFormation deletion policies for its managed resources. To prevent RDS deletion when terminating an Elastic Beanstalk environment, always provision the database separately and use environment variables for the connection string. Memory tip: think “external DB, eternal data” — if the database lives outside the environment, it survives termination.

DVA-C02 Deployment Practice Question

This DVA-C02 practice question tests your understanding of deployment. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. A key principle to apply: elastic Beanstalk-managed RDS instances are deleted upon environment termination.. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

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?

Question 1mediummultiple choice
Read the full NAT/PAT explanation →

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.

Option B is correct because 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.

Key principle: Elastic Beanstalk-managed RDS instances are deleted upon environment termination.

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.

    Related concept

    Elastic Beanstalk-managed RDS instances are deleted upon environment termination.

  • 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.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may 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.

Detailed technical explanation

How to think about this question

When an RDS instance is provisioned within an Elastic Beanstalk environment (via the AWS Management Console or .ebextensions), it is created as a resource of the CloudFormation stack that manages the environment. Terminating the environment triggers a stack deletion, which removes all associated resources, including the RDS instance. By creating the RDS instance externally, the developer can use environment properties (e.g., RDS_HOSTNAME, RDS_PORT, RDS_DB_NAME, RDS_USERNAME, RDS_PASSWORD) that Elastic Beanstalk automatically populates when the database is part of the environment, but these must be manually set for external databases. This decoupling is critical for production workloads where database data must survive environment updates or termination.

KKey Concepts to Remember

  • Elastic Beanstalk-managed RDS instances are deleted upon environment termination.
  • External RDS instances provide data persistence independent of environment lifecycle.
  • Applications connect to external RDS via environment variables.
  • Decoupling resources allows for easier environment tear-down and recreation without data loss.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Elastic Beanstalk-managed RDS instances are deleted upon environment termination.

Real-world example

How this comes up in practice

A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Elastic Beanstalk-managed RDS instances are deleted upon environment termination. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.

What to study next

Got this wrong? Here's your next step.

Review elastic Beanstalk-managed RDS instances are deleted upon environment termination., then practise related DVA-C02 questions on the same topic to reinforce the concept.

Related practice questions

Related DVA-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DVA-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DVA-C02 question test?

Deployment — This question tests Deployment — Elastic Beanstalk-managed RDS instances are deleted upon environment termination..

What is the correct answer to this question?

The correct answer is: Create the RDS instance outside of Elastic Beanstalk and configure the application to connect to it using environment variables. — Option B is correct because 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.

What should I do if I get this DVA-C02 question wrong?

Review elastic Beanstalk-managed RDS instances are deleted upon environment termination., then practise related DVA-C02 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

Elastic Beanstalk-managed RDS instances are deleted upon environment 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 →

How Courseiva writes practice questions · Editorial policy

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: Option A is correct because 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: Option C is correct because 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.

Keep practising

More DVA-C02 practice questions

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

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.