I am building an Amazon Echo skill, and for some reason I cant figure out how to install pymysql on to AWS Lambda to connect the AWS Lambda function to the Amazon RDS (Mysql) Data Base.
Asked
Active
Viewed 6,792 times
1 Answers
3
Edit: This is a possible duplicate of How to install pymysql on AWS lambda
You need to first create the Lambda function deployment package, and then use the console or the CLI to upload the package. This basically packages up all your non-default libraries - like pymysql. Creating a Deployment Package (Python)
For example, to just install and package pymysql
:
pip install pymysql -t /path/to/project-dir
zip -r lambda.zip /path/to/project-dir
Then upload lambda.zip
through the console or AWS CLI.

John Veldboom
- 2,049
- 26
- 29
-
Got all of that taken care of, now the issue is that it is timing out without connecting to the RDS database. Some kind of VPC issue. I even added VPC privilege to the role. Now I am not getting any errors but after waiting the request just times out. – Kashif Mik Oct 02 '17 at 14:19
-
Check out [Configuring a Lambda Function to Access Resources in an Amazon VPC](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html) Since you're behind a VPC, you need to setup not only the Lambda role to use, but also security groups on the Lambda function and RDS instance. – John Veldboom Oct 02 '17 at 14:25