Home > Enterprise >  Making AWS RDS reachable from a Lambda function
Making AWS RDS reachable from a Lambda function

Time:09-17

I have a simple C# Lambda function that inserts a record into a table using Entity Framework. When I run the test locally (from my desktop machine) I can connect to the remote database just fine and the record gets inserted into the table at AWS just fine. When I upload the lambda to AWS and then send it data the function times out after 15 seconds. Since the code runs on my (external) desktop machine I am assuming that Lambda does not have permissions to connect to the internal RDS database from inside aws.

I have added AmazonRDSFullAccess to the permissions of the Lambda function. The Lambda function still times out.

What am I missing?

CodePudding user response:

The Lambda function needs to be deployed to the same VPC as the RDS server.

It does not need the AmazonRDSFullAccess IAM policy attached.

The security group for the RDS server needs to allow inbound connections from the security group assigned to the Lambda function.

  • Related