I've created a VPC (due to the RDS connectivity needs inside the lambdas) in AWS which has internet access most of the time, but some times my outside requests timeout (mostly these happen with SES as they're the majority of outside requests). I've configured my VPC the following way (sorry, not in the created order, just reading them off AWS):
- VPC with 172.30.0.0/16 CIDR
- 3 private subnets with 172.30.0.0/24, 172.30.1.0/24, 172.30.2.0/24 and a different availability zone for each (1a, 1b, 1c) with 0.0.0.0/0 route targeting my NAT
- 1 public subnet with 172.30.3.0/24 to 1a availability zone with a 0.0.0.0/0 route targeting my IGW
- 2 route tables (private and public) with the 3 private subnets in the private route table and the public one in it's own
- Security groups for lambdas directing all outbound traffic to 0.0.0.0/0
- Lambdas are configured to use these subnets and the given security group.
I'm not understanding why my internet requests some times fail from inside the VPC, it's almost as if the lambda gets started at some availability zone and that specific one does not have access to the internet inside the vpc.
EDIT: Resolved! I had the public subnet listed in my lambda function which caused the timeouts