Question 615 of 724
DVA-C02 Security Practice Question
A developer needs to securely store database credentials for a Lambda function. Which AWS service should be used?
⚠ Common exam trap
Watch out — candidates often confuse AWS KMS (which only manages encryption keys) with AWS Secrets Manager (which manages the full lifecycle of secrets), leading them to choose KMS because they think 'encryption' is the primary requirement, when in fact the question asks for secure storage and management of credentials, not just encryption.
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
✓
AWS Secrets Manager
AWS Secrets Manager is the correct service because it is purpose-built for securely storing, rotating, and managing database credentials and other secrets throughout their lifecycle. It integrates natively with Lambda via the AWS Secrets Manager API, allowing the function to retrieve credentials at runtime without hardcoding them, and supports automatic rotation using built-in or custom Lambda rotation functions. This makes it the ideal choice for securely handling database credentials in a serverless application.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
AWS Secrets Manager
Why this is correct
AWS Secrets Manager enables automatic rotation of database credentials on a configurable schedule, satisfying the developer's need to avoid hard-coded secrets in Lambda environment variables. Its built-in integration with Amazon RDS, Redshift, and DocumentDB allows the Lambda function to retrieve current credentials at runtime via the GetSecretValue API, eliminating manual secret management.
- ✗
AWS CloudHSM
Why it's wrong here
AWS CloudHSM provides dedicated hardware security modules (HSMs) for cryptographic operations and secure storage of encryption keys. While offering the highest level of security for keys, it is not designed as a direct secret management solution for application credentials like database usernames and passwords. Integrating applications to retrieve and manage database credentials directly from CloudHSM would be overly complex and inefficient, lacking the built-in rotation and simplified access patterns offered by dedicated secret managers.
- ✗
AWS KMS
Why it's wrong here
AWS Key Management Service (KMS) is primarily a managed service for creating and controlling encryption keys used to encrypt data. While KMS can be used to encrypt sensitive data, including database credentials, it does not *store* the secrets themselves. A developer would still need to store the encrypted credentials in another service and then use KMS for decryption, which adds complexity and doesn't provide the automatic rotation or direct secret retrieval capabilities needed for efficient credential management.
- ✗
Amazon DynamoDB
Why it's wrong here
Amazon DynamoDB is a high-performance NoSQL database service optimized for low-latency data access and scalability. Although one could technically store database credentials within a DynamoDB table, it lacks the specialized security features, automatic rotation capabilities, granular access controls, and comprehensive audit trails specifically designed for secret management. Using a general-purpose database for this purpose introduces unnecessary operational overhead and potential security vulnerabilities compared to a dedicated secrets management service.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
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 24, 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.