Reputation: 439
I have a python script running on AWS Lambda that tries to connect to a MariaDB I set up on an EC2 Instance.
The script can't execute because the security group of my EC2 instance only allows certain IPs. How can I allow Lambda functions to access?
Upvotes: 7
Views: 8534
Reputation: 9401
The recommended way is to place your Lambda inside VPC. This will allow you to choose a subnet and a security group for your Lambda. So all you need to do after that is to modify your EC2 security group to allow connections either from the Lambda subnet (not so good) or from the Lambda security group (much better).
Upvotes: 8