Reputation: 665
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
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.
Upvotes: 2
Reputation: 993
Check for IAM policy for the lambda function. It should have the below permission:
S3:PutBucketNotification
Upvotes: 1