enabling-lambda-vpc-internet-access

Configures NAT Gateway infrastructure and routing to give VPC Lambda functions internet access.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill enabling-lambda-vpc-internet-access-sakicodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: enabling-lambda-vpc-internet-access
Source: https://github.com/sakicodes/BuildFestHackathon26/tree/main/.agents/skills/enabling-lambda-vpc-internet-access
Command: npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill enabling-lambda-vpc-internet-access-sakicodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AWS Lambda functions deployed inside VPC subnets cannot receive public IP addresses, so they cannot reach the internet. This Skill guides the creation of NAT Gateway infrastructure, public/private subnet routing, and security group rules to restore outbound internet connectivity. ## Core Features & Use Cases - VPC Network Analysis: Inspects the Lambda function's subnets, route tables, Internet Gateways, and existing NAT Gateways before making changes. - NAT Gateway Provisioning: Creates Internet Gateways, public subnets, Elastic IPs, and NAT Gateways with correct route table associations. - Cost-Safe Execution: Presents all billable resources and estimated costs for explicit user approval before creating anything. - Use Case: A Lambda function in a private subnet fails to call an external API. Use this Skill to diagnose the missing NAT route and provision the full NAT Gateway path to the internet. ## Quick Start Enable internet access for my VPC Lambda function named payment-processor by setting up a NAT Gateway and updating its subnet routing.

Frequently Asked Questions about enabling-lambda-vpc-internet-access

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I give a Lambda function in a VPC internet access?

Lambda functions in VPC subnets cannot receive public IPs, so internet access requires a NAT Gateway in a public subnet. Route the Lambda subnet's 0.0.0.0/0 traffic to the NAT Gateway, which forwards it through an Internet Gateway.

How to set up a NAT Gateway for Lambda using AWS CLI?

Allocate an Elastic IP, create the NAT Gateway in a public subnet with aws ec2 create-nat-gateway, then add a 0.0.0.0/0 route to the NAT Gateway in the route table associated with the Lambda function's private subnets.

Why can't my VPC Lambda function reach the internet?

VPC-attached Lambda functions only receive private IP addresses, so they cannot route directly to the internet. Without a NAT Gateway and a 0.0.0.0/0 route in the subnet's route table, all outbound internet traffic fails.

Why is my NAT Gateway not working after creation?

Verify the route table associated with the Lambda subnets has a 0.0.0.0/0 route pointing to the NAT Gateway and that the NAT Gateway is in available state. VPC networking changes can also take 1-2 minutes to propagate.

What are the costs and alternatives to NAT Gateway for Lambda?

NAT Gateways carry a monthly base cost plus per-GB data processing charges, and Elastic IPs incur additional fees. For reaching specific AWS services only, VPC endpoints are a cheaper alternative that avoids NAT Gateway costs.