1
votes

I want my lambda function to access the database aurora serverless mysql. After some research, I found that we need to keep the lambda under the same VPC as aurora serverless. But keeping lambda in VPC leads to increase the cold start and also in order to access the internet we need to use NAT gateway which leads to additional cost. Since our application is small we cannot afford additional cost. Is there any other way we can access the aurora serverless database without keeping the lambda function in vpc?

2

2 Answers

0
votes

maybe for the small application you can reduce the security level and run you serverless Aurora in the default VPC with the default security group. I mean to make the public access to the database with the login/password security gate only. Yes, it is less secure but your billing will be small.

I do not see another way.

0
votes

Aurora Serverless has a feature called Data API. This allows you to access the database over http from outside the VPC or from anywhere on the Internet.

So, your database can be in a private VPC and your Lambda can be outside the VPC.

However, at the time of writing this, Data API has a high latency. Simple requests can take up to 200 ms to complete.