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
gefragt vor einem Jahr654 Aufrufe
3 Antworten
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
EXPERTE
beantwortet vor einem Jahr
  • 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
EXPERTE
beantwortet vor einem Jahr
  • 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
EXPERTE
beantwortet vor einem Jahr
  • I have updated the post and included the code. Thanks for looking!

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen