简体   繁体   中英

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?

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.

事实证明,由于回调死锁,Lambda 正在超时 RDS 连接,如下所述: https : //stackoverflow.com/a/42619071/2373113其他需要注意的是,必须在规则中明确启用同一安全组内的流量.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM