Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Security group for AWS Lambda to access RDS

Was not able to find any security groups for AWS Lambda.

Is there a way to allow access from AWS Lambda to RDS without alowing all IPs (0.0.0.0/0) and without allowing all Amazon IP Range?

like image 850
deeptowncitizen Avatar asked Feb 12 '16 07:02

deeptowncitizen


2 Answers

This feature is out as of yesterday

https://aws.amazon.com/blogs/aws/new-access-resources-in-a-vpc-from-your-lambda-functions/

like image 153
user5919440 Avatar answered Oct 23 '22 01:10

user5919440


As @user5919440 suggests, now that this new feature is out:

https://aws.amazon.com/blogs/aws/new-access-resources-in-a-vpc-from-your-lambda-functions/

...you simply need to tell AWS Lambda which VPC subnets to bind to your function. The function then can communicate with any AWS service that also has access to that subnet.

This means that you should be able to add a security group in your RDS that allows traffic from the same internal subnet (10.x.x.x) that your Lambda function is bound to.

like image 45
Todd Price Avatar answered Oct 23 '22 03:10

Todd Price