enabling-lambda-vpc-internet-access

Provision NAT gateway infrastructure to enable outbound internet access for Lambda functions in VPC private subnets.

2.3k|234|Updated Apr 23, 2026
One-click install
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill enabling-lambda-vpc-internet-access-aws
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: enabling-lambda-vpc-internet-access
Source: https://github.com/aws/agent-toolkit-for-aws/tree/main/skills/specialized-skills/networking-and-content-delivery-skills/enabling-lambda-vpc-internet-access
Command: npx skills add https://github.com/aws/agent-toolkit-for-aws --skill enabling-lambda-vpc-internet-access-aws

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Lambda functions in a VPC private subnet cannot access the internet; this skill enables outbound internet access by provisioning NAT Gateway infrastructure, configuring routing, and adjusting security groups to support necessary outbound traffic.

Core Features & Use Cases

  • NAT Gateway provisioning to enable outbound internet access from private subnets.
  • Route table updates for private subnets to route 0.0.0.0/0 through NAT Gateway.
  • Security group adjustments to allow outbound HTTP/HTTPS traffic for Lambda.
  • Use case: A Lambda function in a private subnet needs to call external APIs or fetch dependencies during cold starts.

Quick Start

Initiate NAT Gateway-based internet access for the Lambda function in its VPC to enable outbound connectivity.

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 enable internet access for a Lambda function in a VPC private subnet?

To enable internet access for a Lambda function in a VPC private subnet, you provision a NAT Gateway and update route tables to direct 0.0.0.0/0 traffic through it. This setup allows the function to successfully make outbound API calls.

Why does my Lambda function in a VPC fail to make outbound API calls?

Lambda functions in VPC private subnets lack internet access because default routing does not provide an outbound path. Configuring a NAT Gateway and updating route tables resolves this by routing outbound HTTP and HTTPS traffic correctly.

What is the best way to configure route tables for AWS Lambda VPC internet access?

The best way to configure route tables for Lambda VPC internet access is updating the private subnet route table to point 0.0.0.0/0 traffic to a provisioned NAT Gateway. Security groups must also allow outbound HTTP and HTTPS traffic.

Do I need a NAT Gateway to allow my Lambda function to fetch dependencies during cold starts?

Yes, if your Lambda function resides in a private subnet, a NAT Gateway is required to fetch external dependencies during cold starts. The Gateway routes outbound traffic from the private subnet to the internet securely.

Can I use an Internet Gateway instead of a NAT Gateway for Lambda VPC internet access?

An Internet Gateway only supports resources in public subnets, while Lambda functions requiring outbound access should reside in private subnets. You must use a NAT Gateway in a public subnet to route private subnet traffic to the Internet Gateway.