How to connect AWS Lambda to MariaDB SkySQL with IPv4 address

0

What I'm doing is using AWS Lambda with Serverless-Express to host my Express API via AWS. I've done that for the most part, but my endpoints that attempt to query my MariaDB SkySQL database are not working, and from the CloudWatch logs it looks like the database connection is timing out.

I think the issue is that SkySQL isn't recognizing AWS Lambda as having proper permissions to access the database. In my SkySQL database I have to manually add IPv4 addresses that are allowed to query the database. My question is, how do I get the IPv4 address(es), and/or is there a better way to do this?

已提問 2 年前檢視次數 304 次
1 個回答
1

Hi, @Ronkillo123

MariaDB SkySQL assumes you are on the internet.

Your Lambda function can be integrated into your VPC.
Lambda integrated into the VPC enables outbound communication to the Internet via a NAT gateway / NAT instance.

Since you can attach an Elastic IP address to NAT, the IP address will be fixed.

https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/?nc1=h_ls

profile picture
專家
iwasa
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南