SAP-C02 Design for New Solutions Practice Question
A company is designing a serverless application using AWS Lambda. The function needs to access a VPC resource. What is the correct way to configure this?
⚠ Common exam trap
It's easy for candidates to confuse external connectivity (Internet Gateway, NAT Gateway) with internal VPC access, mistakenly thinking those components are required for a Lambda function to reach resources within the same 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
✓
Assign the Lambda function to the VPC and configure a security group
Lambda functions must be attached to a VPC and assigned a security group to access resources within the VPC, such as an RDS database or an Elasticache cluster. This configuration creates an elastic network interface (ENI) in the VPC, allowing the function to communicate with VPC resources via private IP addresses. The security group acts as a virtual firewall to control inbound and outbound traffic for the Lambda function.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Attach an Internet Gateway to the VPC
Why it's wrong here
Internet Gateway is for public internet access.
- ✓
Assign the Lambda function to the VPC and configure a security group
Why this is correct
Lambda in VPC requires a security group and VPC configuration.
- ✗
Set up a VPC peering connection
Why it's wrong here
VPC Peering is not required for Lambda to access resources in the same VPC.
- ✗
Configure a NAT Gateway in the public subnet
Why it's wrong here
NAT Gateway is for outbound internet from private subnets.
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
This SAP-C02 question is part of Courseiva's 1,660-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.