Question 71 of 1,616
SecurityhardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to store the connection string in AWS Secrets Manager and enable automatic rotation with a custom Lambda function. This is correct because Secrets Manager natively supports scheduled secret rotation using a custom Lambda rotation function, allowing you to meet the quarterly rotation requirement while encrypting the secret at rest with a customer-managed KMS key. For the AWS Certified Developer Associate DVA-C02 exam, this scenario tests your understanding of how to combine encryption, key management, and automated rotation for Lambda environment variables—a common real-world security pattern. A frequent trap is choosing AWS Systems Manager Parameter Store, which lacks native rotation support, or assuming Lambda environment variables alone can be encrypted with a customer-managed key (they use the default AWS managed key). Remember the mnemonic: “Secrets rotate, Parameters don’t” to quickly distinguish the two services for rotation requirements.

DVA-C02 Security Practice Question

This DVA-C02 practice question tests your understanding of security. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. 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 company has an AWS Lambda function that processes sensitive financial data. The function uses environment variables to store database connection strings. A security audit requires that all sensitive data be encrypted at rest and in transit. The developer must ensure that the environment variables are encrypted with a customer-managed key that is rotated quarterly. What should the developer do?

Question 1hardmultiple 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

Store the connection string in AWS Secrets Manager and enable automatic rotation with a custom Lambda function

Option B is correct because AWS Secrets Manager natively supports automatic rotation of secrets using a custom Lambda function, which meets the quarterly rotation requirement. Secrets Manager also encrypts secrets at rest using KMS, and the customer can specify a customer-managed key (CMK) for encryption, satisfying the encryption-at-rest and customer-managed key requirements. Additionally, Secrets Manager enforces encryption in transit via TLS when retrieving secrets, fulfilling the full security audit mandate.

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.

  • Use AWS Systems Manager Parameter Store with a SecureString parameter using an AWS managed key

    Why it's wrong here

    Parameter Store does not support automated rotation of secret values; you would have to implement manual rotation, which does not meet the automatic quarterly requirement.

  • Store the connection string in AWS Secrets Manager and enable automatic rotation with a custom Lambda function

    Why this is correct

    Secrets Manager supports automatic rotation with custom Lambda functions, allowing you to rotate the secret every 90 days using a customer-managed KMS key.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Encrypt the environment variables using the Lambda service key

    Why it's wrong here

    The Lambda service key is AWS-managed and cannot be used for customer-scheduled rotation. Also, environment variables are not ideal for frequent rotation.

  • Use AWS KMS to encrypt the environment variables and set a manual rotation policy

    Why it's wrong here

    Manual rotation does not satisfy the requirement for automatic quarterly rotation.

Common exam traps

Common exam trap: answer the scenario, not the keyword

AWS often tests the distinction between rotating the encryption key (KMS) versus rotating the secret value itself, leading candidates to incorrectly choose KMS-based options when the requirement is to rotate the stored credential.

Detailed technical explanation

How to think about this question

Secrets Manager uses a two-tier encryption model: the secret value is encrypted under a KMS CMK (customer-managed key), and the CMK itself can be rotated automatically (yearly by default) or on a custom schedule. However, the quarterly rotation requirement in this question refers to rotating the database connection string (the secret value), not the KMS key. Secrets Manager's automatic rotation feature invokes a custom Lambda function that updates the secret (e.g., with new credentials) on a defined schedule, which is distinct from KMS key rotation. In practice, the Lambda function must be configured with the necessary IAM permissions to update the secret and the database, and the rotation schedule can be set to every 90 days.

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 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. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. 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.

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?

Security — This question tests Security — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Store the connection string in AWS Secrets Manager and enable automatic rotation with a custom Lambda function — Option B is correct because AWS Secrets Manager natively supports automatic rotation of secrets using a custom Lambda function, which meets the quarterly rotation requirement. Secrets Manager also encrypts secrets at rest using KMS, and the customer can specify a customer-managed key (CMK) for encryption, satisfying the encryption-at-rest and customer-managed key requirements. Additionally, Secrets Manager enforces encryption in transit via TLS when retrieving secrets, fulfilling the full security audit mandate.

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.

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 company wants to securely store secrets for a Lambda function. Which AWS service should they use?

medium
  • A.AWS Secrets Manager
  • B.Amazon S3 with server-side encryption
  • C.AWS Key Management Service (KMS)
  • D.AWS Systems Manager Parameter Store

Why A: AWS Secrets Manager is designed to securely store and rotate secrets, making it the best choice for this use case. Option A (SSM Parameter Store) can store secrets but lacks automatic rotation. Option C (KMS) is a key management service, not a secret store. Option D (S3 with encryption) is not a dedicated secrets service.

Keep practising

More DVA-C02 practice questions

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