DVA-C02 Development with AWS Services Practice Question
A developer is deploying a Node.js application on AWS Elastic Beanstalk. The application uses environment variables for database credentials. The developer wants to ensure that the credentials are encrypted at rest and rotated automatically. Which solution meets these requirements with minimal effort?
⚠ Common exam trap
It's easy for candidates to confuse AWS Systems Manager Parameter Store SecureString parameters with Secrets Manager, overlooking that Parameter Store lacks native automatic rotation, which is explicitly required by the 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
✓
Store the credentials in AWS Secrets Manager and retrieve them in the application code. Configure automatic rotation.
AWS Secrets Manager is the correct choice because it provides built-in automatic rotation of secrets (including database credentials) with minimal configuration, and it encrypts secrets at rest using AWS KMS. The developer can retrieve the credentials at runtime via the AWS SDK, avoiding hardcoding or plaintext exposure. Elastic Beanstalk environment properties do not offer encryption at rest or rotation, and while Parameter Store SecureString parameters encrypt at rest, they lack native automatic rotation without additional custom logic.
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 AWS Secrets Manager and retrieve them in the application code. Configure automatic rotation.
Why this is correct
AWS Secrets Manager is the most secure and recommended service for storing sensitive credentials. It encrypts secrets at rest and in transit using AWS Key Management Service (KMS), and critically, it supports automatic rotation of credentials for various database types and other services. This significantly reduces the risk of long-lived, compromised credentials and simplifies credential lifecycle management, aligning with security best practices for a Node.js application on Elastic Beanstalk.
- ✗
Hardcode the credentials in the application code and use environment variables for different environments.
Why it's wrong here
Hardcoding credentials directly within the application code, even if differentiated by environment variables, is a severe security vulnerability. This practice exposes sensitive information to anyone with access to the source code repository, making it difficult to audit, rotate, or revoke credentials without redeploying the application. It fundamentally violates the principle of least privilege and separation of concerns, posing a significant risk to data security.
- ✗
Store the credentials in AWS Systems Manager Parameter Store as SecureString parameters and reference them in the application code.
Why it's wrong here
While AWS Systems Manager Parameter Store SecureString parameters provide encryption for sensitive data using AWS KMS, making them a more secure option than plaintext, they lack built-in automatic rotation capabilities. Manual rotation of credentials stored in Parameter Store is required, which can be operationally complex and prone to human error, increasing the risk of stale or compromised credentials over time. This makes it less ideal for credentials that require frequent updates.
- ✗
Use Elastic Beanstalk environment properties to set the credentials as plaintext environment variables.
Why it's wrong here
Setting credentials directly as plaintext environment variables via Elastic Beanstalk environment properties is highly insecure. These values are not encrypted at rest by default and can be easily viewed by anyone with appropriate permissions to the Elastic Beanstalk environment configuration. Furthermore, this method offers no mechanism for automatic credential rotation, necessitating manual updates and redeployments, which significantly increases the attack surface and operational overhead for managing sensitive data.
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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.