Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No luck getting psycopg2 to work on AWS Lambda. #16

Closed
crowdwave opened this issue Mar 13, 2017 · 3 comments
Closed

No luck getting psycopg2 to work on AWS Lambda. #16

crowdwave opened this issue Mar 13, 2017 · 3 comments

Comments

@crowdwave
Copy link

Hey there

I've given this a shot but nothing I do will get psycopg2 to run on my Lambda. It never gets past trying to establish the connection and I can’t even get any sort of error message - just complete silence from that point in my code. Ugh.

Would you be willing to upload to github a zipfile of a an AWS Lambda function that you know works and uses psycopg2? Then I could examine it and see what you are doing to make it work.

thanks heaps!

@phouse512
Copy link

hey @crowdwave, I've been working with Lambda recently and used this package to help me get psycopg on my functions.

I took one of my zipped uploads and stripped out my handler code and re-zipped it up and put it on my google drive, you can find the file here: sample_lambda_zip

Hopefully you can modify that handler and see if you can get your code to work. The other thing that I would watch out for is making sure that your Lambda function has network access to your DB.

For example, I host my postgres database using RDS, and I had to add my Lambda function to the RDS vpc and make sure that the routing rules supported incoming requests to it. By default, lambda functions usually get placed in their own VPC, so definitely double check that. I had some troubles there as well when I initially was getting this up and running.

@crowdwave
Copy link
Author

@phouse you are a life saver than you so much - I spent a ridiculous amoutn of time trying to fix the wrong problem - it was the vpc configuration of the lambda function all along.

Thanks massively for your help - once I had known good code I was forced to think of what else it could be.

@phouse512
Copy link

@crowdwave glad it worked out 👍

@jkehler jkehler closed this as completed Apr 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants