Lambda takes a file from S3 and sends it to a postgres RDS table

0

Hey all,

I have lambda code that will take a csv file from S3, check to see if a table name is in postgres, drop if it is there then create a new table and load the file into the created table. The code runs without any errors. Logs say the table was create but when I look at the DB in pgAdmin the table is not there. Lambda is on the vpc with the DB and I have given the proper permissions in IAM. S3_commons is installed along with lambda. Lambda code is aws_s3.table_import_from_s3 too.

Edit is for adding the watchlogs for postgres.

Edit 2 for Answer: While playing around with the code and adding commits. The solution was to have one commit statement at the end.

lambda codePostgreslogs

Gary
已提問 1 年前檢視次數 654 次
3 個答案
1

Hi, I would add code in try catch statement to understand if any error?

If not could be that table us in a different schema.

profile picture
專家
已回答 1 年前
  • Before using this code we had try statements and nothing was throwing errors. I will look into table schemas and see if that bears any fruit. Thanks for the suggestions!

0

Have you checked it’s in the correct schema?

profile picture
專家
已回答 1 年前
  • I will look into it. I am new to postgres so trying to not flood community boards with questions.

0

Maybe you can post the key code snippets (removing/redacting any confidential or proprietary information) of your lambda function here?

profile pictureAWS
專家
已回答 1 年前
  • I have updated the post and included the code. Thanks for looking!

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南