1

I can connect to my database locally just fine (of course with the normal DB endpoint, not the proxy endpoint).

However, I just can't seem to get my lambda function to connect to the same database via my RDS proxy. Every time I run my lambda function:

{
  "errorType": "Error",
  "errorMessage": "connect ETIMEDOUT [ip]:[port]",
  "trace": [
    "Error: connect ETIMEDOUT [ip]:[port]",
    "    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)"
  ]
}

Credentials are hardcoded in the lambda function using the normal user, password, name, port and of course the proxy endpoint.

I'm quite new at this. Any tips on how I can get this to work? I can provide more info if needed.

Thanks :)

1 Answers1

1

My guess is that the Security Group on the RDS Proxy doesn’t allow access from the Lambda.

MLu
  • 24,849
  • 5
  • 59
  • 86
  • Hey MLu, thanks for your answer. My VPC security group has currently only one inbound rule which allows my IP address to connect to the DB (for connecting locally on my mac), What kind of inbound rule or access should I be configuring for my Lambda to be able to access it via the proxy? – Maxime Dupré May 02 '20 at 16:38
  • 1
    Thanks for putting me on the right track. My RDS db and proxy were not on the same security group, so I put them both on the same. Then my lambda had no VPC, so I added the same VPC than my db and proxy. I'm sure I'm mixing up terms and I don't fully understand what I did, but now it works haha. Thanks. – Maxime Dupré May 02 '20 at 17:43