Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Lambda Function Timeout on Connecting To RDS Database through RDS Proxy

I'm trying to test AWS RDS proxy so I created a lambda function and done all steps that are present in this official link

https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda

  • store RDS credentials in Secret Manager
  • create new role and also add Trust Policy
  • in lambda function, from the AWS console, add proxy and its status is available.

When I execute the lambda function, it times out with no errors it seems like the error might be on connecting to db with rds proxy because when I run the lambda function again without proxy, it works just fine.

I initially thought that it might be a security group issue, so I edit the security group of RDS Proxy and update inbound and allow 0.0.0.0 (outbound was already 0.0.0.0).

I used defaut VPC in RDS Database and RDS Proxy. The endpoint of RDS database is public.

like image 233
danish Avatar asked Jan 13 '20 08:01

danish


Video Answer


1 Answers

Since RDS proxy is not available outside the VPC. Configure your lambda function to run inside the VPC. The following link will help:

https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html

like image 151
Humayl Avatar answered Oct 10 '22 02:10

Humayl