0

I have a RDS database and a RDS proxy in one region.

However, I also have a lambda function in a different region that need to connect to the RDS proxy in the first region.

I know that the RDS proxy can't be publicly accessible and need to be within the same VPC as the instance trying to connect to it.

Is there a way to allow a lambda function to connect to a RDS proxy in a different region?

I know that an RDS DB can be publicly accessible, however I was getting sql timeout errors in my lambda functions, which is why I chose to use a RDS proxy.

jtoberon
  • 8,706
  • 1
  • 35
  • 48
Anatol
  • 3,720
  • 2
  • 20
  • 40
  • Have you tried this https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/#:~:text=Sign%20into%20the%20AWS%20Lambda,and%20choose%20Add%20Database%20Proxy. – RajNikhil Marpu Feb 09 '22 at 14:09

1 Answers1

1

I know that the RDS proxy can't be publicly accessible and need to be within the same VPC as the instance trying to connect to it.

I think the part in bold is partially incorrect. The RDS proxy has to be in the same VPC as the RDS database. As far as I can tell, the instance trying to connect doesn't need to be in the same VPC, I think it could also be in a peered VPC.

To answer your question, I would suggest placing the Lambda function in a VPC in the other region, and create a VPC peering connection between the two VPCs.

Mark B
  • 183,023
  • 24
  • 297
  • 295