Courseiva
Question 1,327 of 724
SecurityhardMultiple ChoiceObjective-mapped

DVA-C02 Security Practice Question

A company uses AWS Lambda to process sensitive data. The Lambda function needs to access an RDS database with a password stored in AWS Secrets Manager. The function currently retrieves the secret using the AWS SDK. What is the best practice to secure this setup?

⚠ Common exam trap

Candidates often assume Secrets Manager is always the best practice for secrets, but the question specifically asks for the best practice to secure the setup, and IAM authentication removes the secret entirely, which is more secure than any secret management approach.

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

Configure the Lambda function to use IAM database authentication for RDS.

IAM database authentication eliminates the need to store or retrieve a password entirely. The Lambda function assumes an IAM role that generates a temporary authentication token (valid for 15 minutes) using the AWS SDK, which is then used to connect to RDS via TLS. This approach follows the principle of least privilege and removes the risk of static credentials being exposed or misused.

Answer analysis

Option-by-option breakdown

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

  • Configure the Lambda function to use IAM database authentication for RDS.

    Why this is correct

    Configuring the Lambda function to use IAM database authentication for RDS is the most secure and recommended approach. This method allows the Lambda function to connect using its execution role, generating short-lived, temporary authentication tokens instead of relying on static usernames and passwords. It eliminates the need to store or manage long-term database credentials, significantly enhancing security by leveraging AWS IAM's robust permission model and automatic credential rotation.

  • Store the password as a Lambda environment variable encrypted with KMS.

    Why it's wrong here

    Storing a password as a Lambda environment variable, even if encrypted with KMS, is not a secure practice for sensitive data. While KMS encrypts the variable at rest, it is decrypted and exposed in plain text to the Lambda runtime environment. This creates a vulnerability where anyone with console access to the Lambda function could potentially view the decrypted password, or it could be inadvertently logged in application logs.

  • Use the AWS CLI within the Lambda function to fetch the secret each time.

    Why it's wrong here

    Using the AWS CLI within a Lambda function to fetch a secret each time, typically from AWS Secrets Manager or Parameter Store, still relies on the existence of a traditional database password. Although this approach avoids hardcoding credentials, it introduces network latency for each retrieval and requires the Lambda function's role to have permissions to access the secret store. This method does not eliminate the fundamental security concern of managing and transmitting a password, unlike IAM database authentication.

  • Rotate the secret daily using Secrets Manager and cache it in Lambda.

    Why it's wrong here

    Rotating a secret daily using Secrets Manager and caching it in Lambda improves security over static credentials, but it fundamentally still depends on a traditional password. While caching reduces the frequency of secret retrieval, the Lambda function still needs to handle and manage a password, even if it's frequently updated. This approach is less secure than IAM database authentication, which completely eliminates the need for a password by using temporary, role-based tokens.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, 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 →

How Courseiva writes practice questions · Editorial policy

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.