1
votes

I am trying to connect to Redshift in Python using psycopg2. The code works on my local and connects properly. But if I use the same credentials in the same code and upload it to Lambda, I get this issue.

"errorMessage": "FATAL: no pg_hba.conf entry for host \"ip\", user \"username\", database \"db-name\", SSL off\n"

Do I have to make some changes to my Redshift ?

1

1 Answers

0
votes

Have a look at the code in our "Amazon Redshift Advanced Monitoring" project for an example of a Python Lambda function connecting to Redshift. https://github.com/awslabs/amazon-redshift-monitoring/blob/master/lambda_function.py