- Newest
- Most votes
- Most comments
It's odd that this works and then doesn't; then works again.
From your question I want to clarify: It sounds like the Lambda function is attached to a VPC - so I'm going to go with that assumption.
When you associate your Lambda function with a VPC you nominate the subnets that it should be attached to. From time to time your Lambda function may run in a different back-end context (i.e. different physical server; maybe even a different Availability Zone) and at that time it will use a different subnet.
Is it possible that your subnets are not created "equal"? As in, there's a subnet that's working correctly; but another that isn't? It would be easy to test: Start an EC2 instance in each subnet and try the REST API call to see what result you are getting.
If all is well, I'd suggest a creating a support case to troubleshoot more.
If your function is attached to a VPC as implied by your question, make sure that all subnets the function is attached to has a route the NAT Gateway for 0.0.0.0/0.
Hi,
So the issue was indeed with the network configuration of the VPC. Th VPC we have for the AWS Lambda has 3 availability zones and the Subnets was configured by adding both the 3 private and 3 public subnets, which as I understand is wrong since it's the NAT which translates the private IPs and there is no need to add the public subnets (the Lambda Function only connects to the RDS instance). Thank you for your help, really appreciated!
Relevant content
- Accepted Answerasked a year ago
- asked 5 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 5 months ago