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
asked a year ago636 views
3 Answers
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
EXPERT
answered a year ago
  • 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
EXPERT
answered a year ago
  • 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
EXPERT
answered a year ago
  • I have updated the post and included the code. Thanks for looking!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions