Rony Azrak
Rony Azrak

Reputation: 627

AWS Lambda and RDS outside a VPC

From my understanding, I can run AWS Lambda outside a VPC, as well as the RDS and have that set to publicly accessible. That would be the perfect solution for me because my lambda functions need internet access and a NAT Gateway which would allow that when inside a VPC is way too expensive. In which cases is it safe to go for that option? When is it a bad idea to have an RDS outside a VPC? What are the risks?

Upvotes: 3

Views: 1180

Answers (1)

Joseph
Joseph

Reputation: 542

It is a VERY bad idea to expose your SQL server to the public internet. This is a very large security risk and you could eventually lose your data.

The a Nat gateway is too expensive, you could break the project into 2 lambda functions. Have one lambda function invoke attached to the VPC access the DB. This lambda can then invoke a second lambda function outside of the VPC, execute code, and return the results.

Natgateway is still the best solution.

Upvotes: 0

Related Questions