Question 1,431 of 1,616
SecuritymediumMultiple SelectObjective-mapped

Quick Answer

The correct answer is to create a VPC endpoint for DynamoDB and attach the Lambda function to the same VPC. This works because a Lambda function must be VPC-enabled to use internal VPC resources like security groups and VPC endpoints; without that attachment, the function runs outside the VPC and cannot access DynamoDB through the private endpoint. The VPC endpoint, powered by AWS PrivateLink, allows the Lambda function to reach DynamoDB securely over the AWS network without traversing the public internet, which is essential for compliance and security. On the AWS Certified Developer Associate DVA-C02 exam, this scenario tests your understanding of how Lambda’s VPC attachment interacts with AWS PrivateLink—a common trap is thinking that a NAT gateway or Internet Gateway is needed, but DynamoDB’s VPC endpoint bypasses both. Remember the mnemonic: “Lambda must be in the VPC to use the VPCe.”

DVA-C02 Security Practice Question

This DVA-C02 practice question tests your understanding of security. 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 developer is configuring a Lambda function to access a DynamoDB table in a VPC. Which TWO steps are required to ensure the Lambda function can securely access DynamoDB? (Select TWO.)

Question 1mediummulti select
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

Attach the Lambda function to a VPC.

Option B is correct because attaching the Lambda function to a VPC allows it to access resources within the VPC, such as a DynamoDB table accessed via a VPC endpoint. Without VPC attachment, the Lambda function runs outside the VPC and cannot use VPC endpoints or security groups. Option C is correct because a VPC endpoint for DynamoDB (using AWS PrivateLink) enables private connectivity between the VPC and DynamoDB without traversing the public internet, which is required for secure access from a Lambda function in the VPC.

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.

  • Configure a NAT gateway in the VPC.

    Why it's wrong here

    NAT gateway is for internet access, not DynamoDB.

  • Attach the Lambda function to a VPC.

    Why this is correct

    Lambda must be in the VPC to use VPC endpoint.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create a VPC endpoint for DynamoDB in the VPC.

    Why this is correct

    VPC endpoint allows private connectivity to DynamoDB.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Add a route to the DynamoDB service in the subnet's route table.

    Why it's wrong here

    Route tables are used for VPC endpoints, but IAM role is needed for permissions.

  • Assign a security group to the Lambda function that allows outbound traffic to DynamoDB.

    Why it's wrong here

    DynamoDB is not accessed via security groups.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often think a NAT gateway is required for any outbound traffic from a VPC, but for AWS services like DynamoDB, a VPC endpoint provides a more secure and direct path without internet exposure.

Detailed technical explanation

How to think about this question

When a Lambda function is attached to a VPC, AWS creates an elastic network interface (ENI) in the specified subnets, which uses a security group to control traffic. For DynamoDB access, a Gateway VPC endpoint (using AWS PrivateLink) is created, which adds a prefix list to the route table automatically, directing traffic to DynamoDB through the endpoint without needing a NAT gateway or internet gateway. A common real-world scenario is a Lambda function processing sensitive data from DynamoDB in a private subnet, where the VPC endpoint ensures data never leaves the AWS network, meeting compliance requirements like HIPAA or PCI DSS.

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 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.

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: Attach the Lambda function to a VPC. — Option B is correct because attaching the Lambda function to a VPC allows it to access resources within the VPC, such as a DynamoDB table accessed via a VPC endpoint. Without VPC attachment, the Lambda function runs outside the VPC and cannot use VPC endpoints or security groups. Option C is correct because a VPC endpoint for DynamoDB (using AWS PrivateLink) enables private connectivity between the VPC and DynamoDB without traversing the public internet, which is required for secure access from a Lambda function in the VPC.

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

Keep practising

More DVA-C02 practice questions

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.