![]() ![]() Can someone explain why there is a requirement difference between running it locally and on lambda?įinally, does anyone know what could be wrong in my setup? I'm happy to provide any information in related to this, any general direction to look into would be really helpful. But when I throw the code in lambda function, it’s requiring all these secret manager, VPC security group, SSL, proxy, TCP/IP rules etc. It doesn’t really make sense to me that when I run the code locally, I only need to provide the host, dbname, username, and password, that’s it, and I’m able to write all the queries and function I want. ![]() I tried both database endpoint and database proxy endpoint, none of it works.Lambda function is set to run up to 15 min, and it always stops before it even hits 15 min.IP address is included in the inbound rule.RDS and Lambda are in the same VPC, same subnet, same security group.FATAL: no pg_hba.conf entry for host “ip:xxx”, user "userXXX", database "dbXXX", SSL off.Is the server running on host “db endpoint” and accepting TCP/IP connections on port 5432? could not connect to server: Connection timed out.This probably means the server terminated abnormally before or while processing the request server closed the connection unexpectedly.I’m currently using boto3, psycopg2, and secret manager to get credentials and connect to the database. ![]() ( PostgreSQL versions before 13 usually treated the timeout as applying to the whole query string. If multiple SQL statements appear in a single simple-Query message, the timeout is applied to each statement separately. It is taking too long to connect to the SQL server before the set timeout period expires. I followed this template and modified my code to retrieve the credentials from secret manager instead. The timeout is measured from the time a command arrives at the server until it is completed by the server. However, when I paste the code in Lambda function, it gave me all sorts of errors. I tested my Python + SQL code locally (in VS code and DBeaver) and it works perfectly fine with including only basic credentials(host, dbname, username password). The Timeout:PgSleep event occurs when a server process has called the pgsleep function and is waiting for the sleep timeout to expire. Hello fellow AWS contributors, I’m currently working on a project to set up an example of connecting a Lambda function to our PostgreSQL database hosted on RDS. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |