A Lambda function attached to a VPC can reach RDS but times out on any call to the internet.
IntermediateTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer
Likely causes → Lambda ENIs in a VPC never get public IPs, even in a public subnet. Internet access needs the function in private subnets with a route to a NAT gateway (or VPC endpoints for AWS services).
Diagnose →
aws lambda get-function-configuration --function-name <fn> --query 'VpcConfig'
aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=<subnet-id>
Fix → Move the function to private subnets with 0.0.0.0/0 → nat-xxxx, allow outbound in its SG, and add VPC endpoints for AWS APIs it calls (S3, DynamoDB, Secrets Manager) to avoid NAT costs.
Prevent → Only attach Lambda to a VPC when it needs private resources, and use a standard "private subnets with NAT" pattern when you do.
More on Cloud networking: VPC, firewalls, NAT, VPN and proxies
An EC2 instance in a private subnet hangs on `apt-get update` at `Connecting to archive.ubuntu.com`.BeginnerA new EC2 instance in a "public" subnet can't be reached over SSH from the internet; the SG allows port 22 from your IP.BeginnerThe SG allows inbound 443 and the app works from inside the VPC, but internet clients time out. The subnet NACL allows inbound 443.IntermediateA VPC peering connection is `Active`, but instances in the two VPCs can't ping each other.BeginnerALB targets are `unhealthy` with reason `Target.Timeout`, and VPC Flow Logs show `REJECT` from the ALB's IPs to the instances.BeginnerTwo VPCs are attached to a Transit Gateway, but traffic between them fails.Intermediate