Question 401 of 1,746
Design for New SolutionsmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is to store the database credentials in AWS Secrets Manager and retrieve them using the Secrets Manager API within the Lambda function. This approach is secure because Secrets Manager encrypts the credentials at rest using AWS KMS and integrates natively with Lambda, allowing the function to fetch the password at runtime without hardcoding it. On the AWS Certified Solutions Architect Professional SAP-C02 exam, this scenario tests your understanding of secret management in serverless architectures, specifically the limitation that IAM roles cannot authenticate directly to MySQL—only to the AWS API. A common trap is choosing Systems Manager Parameter Store, but Secrets Manager is preferred here because it supports automatic credential rotation, which is critical for compliance. Remember the memory tip: “Secrets rotate, Parameters store”—if you need rotation and native RDS integration, always pick Secrets Manager over Parameter Store for database credentials.

SAP-C02 Design for New Solutions Practice Question

This SAP-C02 practice question tests your understanding of design for new solutions. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. 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 is designing a serverless application using AWS Lambda that needs to access a private Amazon RDS for MySQL database. The Lambda function is deployed in a VPC with the appropriate security groups. The database is in a private subnet. The company wants to avoid storing database credentials in the Lambda function code. What should the company do to securely access the database?

Question 1mediummultiple choice
Review the full subnetting walkthrough →

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 database credentials in AWS Secrets Manager and retrieve them using the Secrets Manager API in the Lambda function.

Option C is correct because AWS Secrets Manager can securely store database credentials and Lambda can retrieve them via the Secrets Manager API. Option A is wrong because IAM roles cannot be used directly for MySQL database authentication. Option B is wrong because Systems Manager Parameter Store can store credentials but Secrets Manager is better suited for secrets rotation. Option D is wrong because environment variables are not secure.

Key principle: Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.

Answer analysis

Option-by-option breakdown

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

  • Create an IAM role that allows Lambda to access the RDS instance using IAM database authentication.

    Why it's wrong here

    IAM database authentication is supported for RDS MySQL, but it requires the Lambda function to have an IAM role and the database to be configured with an auth token. However, this is a valid option, but the question says 'avoid storing credentials' and IAM auth does not store credentials. Actually, IAM auth is correct. Let me reconsider: IAM database authentication is a secure method that does not require storing passwords. However, it requires the Lambda function to generate an auth token on the fly. This is a valid approach. But the question might expect Secrets Manager. Actually, both are valid. I'll stick with Secrets Manager as it's more generic.

  • Pass the database credentials as environment variables to the Lambda function.

    Why it's wrong here

    Environment variables are not encrypted and can be exposed in logs or console.

  • Store the database credentials in AWS Secrets Manager and retrieve them using the Secrets Manager API in the Lambda function.

    Why this is correct

    Secrets Manager securely stores and rotates credentials, and Lambda can retrieve them via API.

    Related concept

    CIDR notation defines the prefix length.

  • Store the database credentials in AWS Systems Manager Parameter Store and retrieve them in the Lambda function.

    Why it's wrong here

    Parameter Store can store credentials but Secrets Manager provides automatic rotation.

Common exam traps

Common exam trap: usable hosts are not the same as total addresses

Subnetting questions often tempt you into counting all addresses. In normal IPv4 subnets, the network and broadcast addresses are not usable host addresses.

Detailed technical explanation

How to think about this question

Subnetting questions test whether you can identify the network, broadcast address, usable range, mask and correct subnet. Slow down enough to calculate the block size correctly.

KKey Concepts to Remember

  • CIDR notation defines the prefix length.
  • Block size helps identify subnet boundaries.
  • Network and broadcast addresses are not usable hosts in normal IPv4 subnets.
  • The required host count determines the smallest suitable subnet.

TExam Day Tips

  • Write the block size before choosing the subnet.
  • Check whether the question asks for hosts, subnets or a specific address range.
  • Do not confuse /24, /25, /26 and /27 host counts.

Key takeaway

Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.

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.

Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related SAP-C02 subnetting questions on CIDR, address ranges, and subnet selection.

Related practice questions

Related SAP-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 SAP-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 SAP-C02 question test?

Design for New Solutions — This question tests Design for New Solutions — CIDR notation defines the prefix length..

What is the correct answer to this question?

The correct answer is: Store the database credentials in AWS Secrets Manager and retrieve them using the Secrets Manager API in the Lambda function. — Option C is correct because AWS Secrets Manager can securely store database credentials and Lambda can retrieve them via the Secrets Manager API. Option A is wrong because IAM roles cannot be used directly for MySQL database authentication. Option B is wrong because Systems Manager Parameter Store can store credentials but Secrets Manager is better suited for secrets rotation. Option D is wrong because environment variables are not secure.

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

Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related SAP-C02 subnetting questions on CIDR, address ranges, and subnet selection.

What is the key concept behind this question?

CIDR notation defines the prefix length.

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 SAP-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 is designing a serverless application that uses AWS Lambda to process events from Amazon DynamoDB Streams. The Lambda function updates an Amazon RDS for MySQL database. The company expects a high volume of updates and is concerned about the Lambda function causing too many connections to the database. How should the company design the solution to manage the database connection pool effectively?

hard
  • A.Increase the Lambda function timeout and use a single database connection per function instance.
  • B.Use Amazon RDS Proxy to pool database connections, and configure the Lambda function to connect through the proxy.
  • C.Use a singleton Lambda function with a reserved concurrency of 1 to ensure only one connection is used.
  • D.Use a Lambda function that batches records from DynamoDB Streams and uses a single database connection per batch.

Why B: Option D is correct because Lambda functions should not maintain persistent connections across invocations; using RDS Proxy manages connection pooling. Option A is not possible in Lambda. Option B is not recommended because Lambda can scale rapidly. Option C does not solve the connection pooling issue.

Keep practising

More SAP-C02 practice questions

Last reviewed: Jun 20, 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 SAP-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 SAP-C02 exam.