Somnath Rokade
Somnath Rokade

Reputation: 665

s3 trigger event not working when file uploaded by using node js

I am working in node js. I want to execute the trigger when user upload the files to s3. So I created the script in node js which will upload the file to s3 bucket. But s3 event is not fired, however whenever I upload the file to s3 manually then trigger fires.

Please help

Upvotes: 0

Views: 1025

Answers (2)

Raj Paliwal
Raj Paliwal

Reputation: 947

Since in your questions some things are unclear i.e. which method you are using in node js to upload file and what is your configuration in AWS Lambda to trigger the event.

I would recommend If you are using s3.upload() then try to use s3.putObject({}) to upload file in S3.

Check the trigger configuration is rightly created in AWS Lambda, Make sure the Event type as PUT is selected.

AWS Lambda S3 Trigger

Upvotes: 2

Sunny Parekh
Sunny Parekh

Reputation: 993

Check for IAM policy for the lambda function. It should have the below permission:

S3:PutBucketNotification

Upvotes: 1

Related Questions