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 年前653 查看次数
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!

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容