This is essentially the same question as this one. However, the solution utilizing the VPC Endpoint and the solution utilizing the NAT Gateway are not working for me as I describe below.
My setup:
- Multiple lambdas in private subnet of VPC
- There is a NAT Gateway in the public subnet that allows the lambdas to connect to the internet and reach an external API (this is working just fine)
- There is also a VPC Endpoint configured with the correct URL
"com.amazonaws.<REGION>.sqs"
in the private subnet - Security group allows open egress from the lambdas in the private subnet, but does not allow open ingress
I get timeout errors in my Lambas when they try to send to SQS. However, when I modify the security group to allow open ingress, it works!
Questions:
- How are security groups meant to be setup for the SQS VPC Endpoint / NAT Gateway solutions for a lambda in a private subnet in a VPC to send to SQS?
- Is open ingress a requirement to use VPC Endpoint?
- If so, why is it required? To combat this, we tried pulling the ip-ranges (here) from AWS but there are no SQS-specific IPs so we are forced to get all of them in the region and add to a security group (or multiple, since there are a significant number of them).