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

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
전문가
답변함 일 년 전
  • 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
전문가
답변함 일 년 전
  • 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
전문가
답변함 일 년 전
  • I have updated the post and included the code. Thanks for looking!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠