- A
The Lambda function does not have internet access because it is in a VPC without a public IP.
Why wrong: Internet access is not required for Lambda to connect to RDS within the same VPC.
- B
The security group of the RDS database does not allow inbound traffic from the Lambda function's security group.
This is the most common cause: the RDS security group must allow inbound connections from the Lambda's security group on the database port.
- C
The Amazon RDS database is not publicly accessible and the Lambda function cannot resolve the database endpoint.
Why wrong: DNS resolution for RDS endpoints works within a VPC regardless of public accessibility.
- D
The VPC does not have a VPC endpoint for Amazon RDS, and the Lambda function cannot access the database through the NAT gateway.
Why wrong: A VPC endpoint for RDS is only needed for accessing RDS API actions, not for database connections. Since the RDS instance is in the same VPC, a NAT gateway is not required.
Quick Answer
The answer is that the RDS database’s security group lacks an inbound rule allowing traffic from the Lambda function’s security group on the database port. This is the most likely cause because when a Lambda function is configured inside a VPC, it uses an elastic network interface with an attached security group, and the RDS instance’s security group must explicitly permit that inbound traffic; without it, the TCP handshake is silently dropped, forcing the function to wait until its 30-second timeout expires. On the AWS Certified Developer Associate DVA-C02 exam, this scenario tests your understanding of VPC networking and security group stateful filtering, often appearing as a trap where candidates mistakenly blame missing NAT gateways or route tables—but since both resources are in the same VPC, no internet gateway is needed. Remember the key insight: Lambda and RDS can be in the same VPC, but security groups are per-resource firewalls; if the database’s group doesn’t allow the Lambda group’s traffic, the connection fails. A helpful mnemonic is “Same VPC, different SG—check the inbound rule for the DB port.”
DVA-C02 Troubleshooting and Optimization Practice Question
This DVA-C02 practice question tests your understanding of troubleshooting and optimization. Examine the command output carefully: the correct answer depends on what the output actually shows, not on general recall alone. 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 notices that an AWS Lambda function, configured to access an Amazon RDS database in the same VPC, is timing out. The function has a 30-second timeout. CloudWatch Logs show that the function starts execution but never reaches the database. The VPC configuration includes private subnets without a NAT gateway. The RDS database is in the same VPC. What is the most likely cause of the timeout?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue:
"most likely"Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Clue:
"never"Why it matters: Absolute qualifier. True only if the statement has zero exceptions — be cautious of options that seem obvious but break down in edge cases.
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
The security group of the RDS database does not allow inbound traffic from the Lambda function's security group.
Option B is correct because the Lambda function is timing out when trying to connect to the RDS database, which is in the same VPC. The most likely cause is that the RDS database's security group does not have an inbound rule allowing traffic from the Lambda function's security group on the database port (e.g., 3306 for MySQL, 5432 for PostgreSQL). Without this rule, the TCP connection attempt is silently dropped or rejected, causing the Lambda function to wait until its 30-second timeout expires.
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.
- ✗
The Lambda function does not have internet access because it is in a VPC without a public IP.
Why it's wrong here
Internet access is not required for Lambda to connect to RDS within the same VPC.
- ✓
The security group of the RDS database does not allow inbound traffic from the Lambda function's security group.
Why this is correct
This is the most common cause: the RDS security group must allow inbound connections from the Lambda's security group on the database port.
Clue confirmation
The clue words "most likely", "never" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
The Amazon RDS database is not publicly accessible and the Lambda function cannot resolve the database endpoint.
Why it's wrong here
DNS resolution for RDS endpoints works within a VPC regardless of public accessibility.
- ✗
The VPC does not have a VPC endpoint for Amazon RDS, and the Lambda function cannot access the database through the NAT gateway.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often assume the Lambda function needs internet access or a NAT gateway to communicate with an RDS database in the same VPC, overlooking the fact that security group rules are the primary control for inbound traffic within a VPC.
Detailed technical explanation
How to think about this question
When a Lambda function is attached to a VPC, it uses an Elastic Network Interface (ENI) in a private subnet. For the Lambda to connect to an RDS database, the security group attached to the RDS instance must have an inbound rule allowing traffic from the Lambda's security group on the database port. Without this rule, the TCP SYN packet is dropped, and the Lambda's database driver will retry until the function timeout is reached. This is a common misconfiguration because developers often assume VPC placement alone ensures connectivity, but security groups act as stateful firewalls that must explicitly permit traffic.
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.
- →
Troubleshooting and Optimization — study guide chapter
Learn the concepts, then practise the questions
- →
Troubleshooting and Optimization practice questions
Targeted practice on this topic area only
- →
All DVA-C02 questions
1,616 questions across all exam domains
- →
AWS Certified Developer Associate DVA-C02 study guide
Full concept coverage aligned to exam objectives
- →
DVA-C02 practice test guide
How to use practice tests most effectively before exam day
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.
Development with AWS Services practice questions
Practise DVA-C02 questions linked to Development with AWS Services.
Security practice questions
Practise DVA-C02 questions linked to Security.
Deployment practice questions
Practise DVA-C02 questions linked to Deployment.
Troubleshooting and Optimization practice questions
Practise DVA-C02 questions linked to Troubleshooting and Optimization.
DVA-C02 fundamentals practice questions
Practise DVA-C02 questions linked to DVA-C02 fundamentals.
DVA-C02 scenario practice questions
Practise DVA-C02 questions linked to DVA-C02 scenario.
DVA-C02 troubleshooting practice questions
Practise DVA-C02 questions linked to DVA-C02 troubleshooting.
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?
Troubleshooting and Optimization — This question tests Troubleshooting and Optimization — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The security group of the RDS database does not allow inbound traffic from the Lambda function's security group. — Option B is correct because the Lambda function is timing out when trying to connect to the RDS database, which is in the same VPC. The most likely cause is that the RDS database's security group does not have an inbound rule allowing traffic from the Lambda function's security group on the database port (e.g., 3306 for MySQL, 5432 for PostgreSQL). Without this rule, the TCP connection attempt is silently dropped or rejected, causing the Lambda function to wait until its 30-second timeout expires.
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.
Are there clue words in this question I should notice?
Yes — watch for: "most likely", "never". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
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 →
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 developer is using AWS Lambda with a VPC configuration. The function needs to access an Amazon RDS instance in the same VPC. The function is timing out after 3 seconds. What is the MOST likely cause?
hard- A.The Lambda function's execution role does not have rds:Connect permission.
- ✓ B.The Lambda function's security group does not allow outbound traffic to the RDS instance.
- C.The Lambda function does not have an RDS proxy configured.
- D.The Lambda function timeout is set too low.
Why B: Option C is correct because Lambda functions in a VPC need a NAT gateway or VPC endpoints to access the internet, but to access RDS in the same VPC, they need a route to the RDS subnet. However, the most common cause of timeout is missing a route to the RDS subnet via a VPC peering or transit gateway, but here the RDS is in the same VPC, so the issue is likely that the Lambda function's security group does not allow outbound traffic to the RDS security group. Option A is wrong because RDS proxy is not required. Option B is wrong because the function can access the database directly via its private IP. Option D is wrong because the function timeout is set to 3 seconds, which is the default; it could be increased, but the root cause is connectivity.
Last reviewed: Jun 11, 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.