Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access RDS from VPC Lambda

Is it possible to access a publicly available RDS instance from a Lambda expression in the same VPC, without using a NAT? Could you please point me in the right direction to confugure this? Thanks.

RDS and Lambda have the same VPC, the same Subnets, the same Security group. The security group has 2 inbound rules:

  1. All Type - All Protocol - All Port Range - Source ALB security group
  2. All Type - All Protocol - All Port Range - Source security group itself

Is that correct?

like image 920
Jumpa Avatar asked Oct 15 '25 22:10

Jumpa


1 Answers

The recommended configuration is:

  • Create a Security Group for the AWS Lambda function (Lambda-SG). It does not require any inbound rules.
  • Create a Security Group for the Amazon RDS db instance (DB-SG). It should allow an Inbound connection on the appropriate port (3306?) from Lambda-SG.

That is, DB-SG should specifically reference Lambda-SG as the source of the inbound connection.

like image 139
John Rotenstein Avatar answered Oct 17 '25 12:10

John Rotenstein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!