A Lambda function residing in a VPC needs to access the internet to call a third-party API. How should the VPC be configured?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Attach the Lambda to private subnets and use a NAT Gateway in a public subnet

Lambda functions in a VPC do not have public IPs. They require a NAT Gateway or NAT instance in a public subnet for outbound internet access....

📋Part of AWS Certified Solutions Architect – Associate (SAA-C03) · AWS Certification Practice
Real Exam ScenarioAWS Lambda

A Lambda function residing in a VPC needs to access the internet to call a third-party API. How should the VPC be configured?

✓ Correct Answer & ExplanationAWS Lambda

Correct Answer

Attach the Lambda to private subnets and use a NAT Gateway in a public subnet

Why This Answer Is Correct

Lambda functions in a VPC do not have public IPs. They require a NAT Gateway or NAT instance in a public subnet for outbound internet access.

📚 What This Question Tests

This question evaluates your knowledge of AWS Lambda — a core concept tested in AWS Certified Solutions Architect – Associate (SAA-C03). Understanding AWS Lambda is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.