Enabling Lambda Vpc Internet Access

aws/agent-toolkit-for-aws/skills/specialized-skills/networking-and-content-delivery-skills/enabling-lambda-vpc-internet-access

作者 aws188af2f810ce无许可证2.8K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Enables internet access for AWS Lambda functions deployed in VPC subnets by creating NAT Gateway infrastructure, configuring public/private subnet routing, and updating security groups. Use when a VPC-attached Lambda function cannot reach the internet.

仅含说明DevOps & Cloud
AI 生成的概览

指导配置 NAT 网关、子网路由和安全组,使位于 VPC 中的 AWS Lambda 函数能够访问互联网。

功能
该技能为运行在 VPC 私有子网中的 AWS Lambda 函数提供访问互联网的领域指导。它说明此类函数无法获得公有 IP 地址,因此出站流量必须经由 NAT 网关基础设施,从私有子网经公有子网路由到互联网网关。它指向一份完整配置流程的参考文档,并列出针对 NAT 网关路由、Lambda 超时、安全组出站规则、变更生效延迟和路由表关联的排查要点。
适用场景
当位于 VPC 中的 Lambda 函数无法访问互联网,需要添加 NAT 网关基础设施和路由时使用。也适用于排查相关问题,例如 Lambda 超时、缺少默认路由或路由表关联错误。
运行要求
需要 AWS VPC 网络知识,以及对相关 VPC、子网、路由表、NAT 网关、互联网网关和安全组资源的访问权限。该技能不包含脚本,仅为说明文档加一份参考文档。

Enabling Lambda VPC Internet Access

Overview

Domain expertise for enabling internet access from AWS Lambda functions running inside VPC private subnets. Lambda functions in a VPC cannot receive public IP addresses, so outbound internet access requires NAT Gateway infrastructure that routes traffic from private subnets through a public subnet to an Internet Gateway.

Enable internet access for a VPC Lambda function

To set up NAT Gateway infrastructure and configure routing for a Lambda function that needs internet access, follow the procedure exactly. See Lambda VPC internet access setup procedure [blocked].

Troubleshooting

NAT Gateway not working

Verify the route table associated with the Lambda subnets has a 0.0.0.0/0 route pointing to the NAT Gateway. See the full procedure for details.

Lambda function timeout

Check that security group outbound rules allow the necessary ports and that both the NAT Gateway and Internet Gateway are properly configured.

Network changes not taking effect

VPC networking changes can take 1–2 minutes to propagate. Wait before testing after creating a NAT Gateway or updating route tables.

Route table association issues

Confirm the Lambda function's subnets are associated with the route table that has the 0.0.0.0/0 route to the NAT Gateway.

来源与署名

来源:aws/agent-toolkit-for-aws位于skills/specialized-skills/networking-and-content-delivery-skills/enabling-lambda-vpc-internet-access提交188af2f

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架