dalton5
dalton5

Reputation: 935

"message": "Endpoint request timed out"}: AWS Lambda .net core: {

I always have {"message": "Endpoint request timed out"}.

I use swagger and swagger ui for api.

What I did:

  1. Created a mysql db in RDS
  2. Ensure everything works and is connected (Yes) with publicly accessibble
  3. Created a Lambda function to wrap my existing aspnet core project
  4. Added the custom runtime to support 2.2
  5. Published my lambda function
  6. Setup the permission between the vpc and the role
  7. When I try to access my lambda function I always have: {"message": "Endpoint request timed out"}

I think it's a small config I missed.

How can I investigate to understand what is the issue?

Would you have any ideas on the issue?

Upvotes: 0

Views: 6674

Answers (2)

Oded Ben Dov
Oded Ben Dov

Reputation: 10416

If using API Gateway, it has a global timeout of 29 seconds for all Lambdas it serves, regardless of the Lambda timeout settings

Official docs under API Gateway quotas for configuring and running a REST API

Upvotes: 2

Chris Williams
Chris Williams

Reputation: 35238

This timeout will be the result of a network connectivity issue.

I would start off by saying you should keep this network connectivity between your Lambda and your RDS private. If the RDS is public you would need to whitelist to allow a large range of IPs to allow inbound access (to cover all Lambdas in the region). This means any Lambda could connect to your RDS.

Instead you should keep the RDS as a private instance and configure your Lambda to operate within a VPC. Then when your Lambda connects to the RDS it will be connecting via the private network without traversing the public internet.

Finally ensure that the security group for your RDS allows inbound access from either the security group attached to the Lambda (this is decided when you add the Lambda to the VPC) or the subnet CIDR ranges the Lambda lives in.

Upvotes: 1

Related Questions