- Newest
- Most votes
- Most comments
Internet access from a private subnet requires either 1) network address translation (NAT) + internet gateway; or 2) Interface Endpoint.
Options:
-
To give internet access to an Amazon VPC-connected Lambda function, route its outbound traffic to a NAT gateway or NAT instance in a public subnet. For an example setup, see VPC with servers in private subnets and NAT.
-
Use Interface Endpoints to connect to AWS services from within an Amazon VPC without internet access.
Given the time-out, I suspect a Security Group issue. I suggest you use Reachability Analyzer to confirm connectivity.
The high-level steps are:
- Get the network interface IDs for Lambda functions
- Create and analyze a path with Reachability Analyzer
- View the results of the path analysis
Hello.
You say that Lambda is connected to a VPC, but in that case, is there a route to connect to SecretsManager?
If you are connecting Lambda to a VPC, you will need to set up a NAT Gateway or VPC endpoint to access each AWS service.
https://repost.aws/knowledge-center/internet-access-lambda-function
Also, can I check Lambda logs with CloudWatch Logs?
If a request is received from API Gateway to Lambda, logs will be output to CloudWatch Logs.
Hi,
I will suggest you to reduce the number of retries and connection timeouts for the AWS SDK client. This will allow actual error to be logged instead of a Lambda function timeout out while re-trying a connection to an unavailable endpoint.
See Retries and timeouts documentation for AWS SDK for .NET.
Once you identify the problematic endpoint, you can focus on fixing connectivity issues with it.
Best regards,
Relevant content
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 3 years ago