Question 462 of 1,616
DeploymenteasyMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is to set environment properties in the Elastic Beanstalk environment configuration. This is the best approach because Elastic Beanstalk injects these properties as environment variables directly into the application’s runtime, allowing a Node.js application to securely access database credentials via `process.env` without ever hardcoding them in source code or deployment artifacts. On the AWS Certified Developer Associate DVA-C02 exam, this question tests your understanding of secure credential management and the principle of least privilege—a common trap is choosing to store credentials in a configuration file within the application bundle, which violates security best practices. Remember that Elastic Beanstalk environment properties are separate from your code, making them ideal for sensitive values like database passwords. A useful memory tip: think of environment properties as “runtime secrets” that stay out of your source code, keeping your deployments both secure and flexible.

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. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. 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 deploying a Node.js application to AWS Elastic Beanstalk. The application uses environment variables for database credentials. What is the BEST way to securely provide these credentials to the application?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "best"

    Why it matters: Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

Question 1easymultiple choice
Full question →

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

Set environment properties in the Elastic Beanstalk environment configuration.

Option D is correct because Elastic Beanstalk allows you to set environment properties in the environment configuration, which are injected as environment variables into the application's runtime. This approach keeps sensitive credentials out of the source code and deployment artifacts, adhering to the principle of least privilege and secure credential management. For a Node.js application, these environment variables can be accessed via `process.env`, providing a secure and flexible way to manage database credentials without hardcoding or storing them in files.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Store the credentials in a file in the source code repository.

    Why it's wrong here

    Storing in source control exposes secrets.

  • Store the credentials in the application's configuration file within the deployment package.

    Why it's wrong here

    Storing in the deployment package is insecure.

  • Hardcode the credentials in the application code.

    Why it's wrong here

    Hardcoding is insecure.

  • Set environment properties in the Elastic Beanstalk environment configuration.

    Why this is correct

    Environment properties are secure and easily managed.

    Clue confirmation

    The clue word "best" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may think storing credentials in a configuration file (Option B) is acceptable because it separates code from configuration, but they overlook that the configuration file is still part of the deployment package and can be accessed by anyone with access to the artifact or the running environment.

Detailed technical explanation

How to think about this question

Elastic Beanstalk environment properties are stored in the environment's configuration and are passed to the EC2 instances via the Elastic Beanstalk agent, which sets them as OS-level environment variables before the application starts. For Node.js, these are accessed via `process.env.PROPERTY_NAME`, and they are not written to disk, reducing the risk of exposure through log files or snapshots. In a real-world scenario, you could further enhance security by using AWS Systems Manager Parameter Store or AWS Secrets Manager to store credentials, and then retrieve them at runtime via the AWS SDK, but the question specifically asks for the best way among the given options, and environment properties are the most secure choice listed.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

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

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

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 — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Set environment properties in the Elastic Beanstalk environment configuration. — Option D is correct because Elastic Beanstalk allows you to set environment properties in the environment configuration, which are injected as environment variables into the application's runtime. This approach keeps sensitive credentials out of the source code and deployment artifacts, adhering to the principle of least privilege and secure credential management. For a Node.js application, these environment variables can be accessed via `process.env`, providing a secure and flexible way to manage database credentials without hardcoding or storing them in files.

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

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "best". Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

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

1 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 deploying a web application on AWS Elastic Beanstalk. The application uses a relational database and requires a custom environment variable for the database connection string. The developer has created an Elastic Beanstalk environment and wants to set the environment variable securely without exposing it in the source code or configuration files. The developer also wants to ensure that the environment variable is available to the application instances at deployment time. What is the BEST way to achieve this?

medium
  • A.Set the environment variable using the Elastic Beanstalk console or CLI by configuring environment properties.
  • B.Store the connection string in AWS Systems Manager Parameter Store and retrieve it from the application code at runtime.
  • C.Hardcode the connection string in the application code and commit it to the source repository.
  • D.Store the connection string in a file named 'env.txt' in the application source bundle and read it at application startup.

Why A: Option B is correct because Elastic Beanstalk allows setting environment properties in the environment configuration, which are securely passed to the instances. Option A is incorrect because storing the connection string in a plain text file is insecure. Option C is incorrect because hardcoding the value in the application code is not secure and not a best practice. Option D is incorrect because although AWS Systems Manager Parameter Store can store the value, the application would need to retrieve it at runtime, adding complexity; Elastic Beanstalk environment properties are simpler and automatically injected.

Keep practising

More DVA-C02 practice questions

Last reviewed: Jun 24, 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.