DVA-C02 Development with AWS Services Practice Question
A developer is using AWS Lambda with an Amazon RDS MySQL database. The Lambda function frequently times out when connecting to the database. What is the MOST likely cause?
⚠ Common exam trap
Test-takers frequently assume timeout issues are due to insufficient memory or IAM permissions, but the real cause is almost always a network connectivity problem when Lambda cannot reach the RDS instance inside a VPC.
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 Lambda function is not attached to the same VPC as the RDS instance
Lambda functions must be attached to the same VPC as the RDS instance to connect via a private IP address. Without VPC attachment, the Lambda function attempts to connect over the public internet, which can cause timeouts due to network latency, security group restrictions, or the RDS instance being configured as publicly inaccessible.
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 is not configured with enough memory
Why it's wrong here
Insufficient memory primarily impacts the computational capacity of the Lambda function, leading to crashes, timeouts, or slow processing if the workload exceeds available resources. However, memory allocation does not directly govern the ability to establish a fundamental network connection to an external resource like an RDS instance. Network connectivity issues are typically related to VPC configuration, security groups, or routing, not the function's allocated memory.
- ✗
The Lambda function is not using a reserved concurrency limit
Why it's wrong here
Reserved concurrency is a control mechanism designed to manage the scaling behavior of a Lambda function, ensuring it has a guaranteed number of concurrent executions or preventing it from exceeding a specific limit. This setting directly affects how many instances of the function can run simultaneously, but it has no bearing on the underlying network configuration or the ability of an individual function invocation to establish a TCP connection to an RDS database. If the limit is reached, new invocations are throttled, not blocked by network errors.
- ✓
The Lambda function is not attached to the same VPC as the RDS instance
Why this is correct
An Amazon RDS MySQL instance is deployed within a private Virtual Private Cloud (VPC) and is not publicly accessible by default, requiring private network access. For a Lambda function to connect to this private RDS instance, it must be configured to operate within the same VPC as the database, or a peered VPC, with appropriate security group rules allowing outbound traffic. Without this explicit VPC configuration, the Lambda function executes in the AWS managed network, lacking the necessary private network interface to reach the RDS endpoint directly, resulting in connection failures.
- ✗
The Lambda function's execution role lacks RDS permissions
Why it's wrong here
The Lambda function's execution role defines the AWS API actions the function is authorized to perform on other AWS services, such as reading from S3 or invoking other Lambda functions. However, connecting to a relational database like RDS involves establishing a TCP connection to the database endpoint and authenticating using database-specific credentials (username and password), not AWS IAM permissions. Therefore, a lack of RDS-related IAM permissions on the execution role would not prevent the underlying network connection from being established, though it might prevent API calls to manage the RDS instance itself.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.