S3 Put Trigger Not Triggering Lambda Function

0

I have created a lambda that should be triggered anytime an object is added to a bucket with a specific directory. I have set the trigger on this specific bucket and allowed for any object create to trigger the lambda:

Enter image description here

I have confirmed that this trigger is listed in the event notifications of the specific bucket I want and is setup correctly:

Enter image description here

I then upload a file to the specific directory within this bucket which should trigger the lambda, but it never seems to trigger:

Enter image description here

My upload occurred at 10:25:00 (UTC-05:00), but I have no new cloudwatch logs for this notification:

Enter image description here

I also confirmed in Lambda that it was never invoked at this time:

Enter image description here

This post is ~25 minutes after attempting an upload so it does not seem to be an issue with needing to wait 10-15 minutes to get the log information. I also can confirm that it is not an issue with the Lambda as all testing is successful using a test put object:

Enter image description here

Which runs successfully and generates a cloudwatch log:

Enter image description here

I've also attempted a few different methods of this trigger with varying prefixes. In between theses changes I have deleted the trigger and created it anew to make sure that there are no issues. I have also made sure the trigger allows for any s3:ObjectCreated:* event. Finally, I have confirmed that IAM policies are correct. I am unclear as to why this trigger will not work. Any help would be appreciated.

Dave
asked 4 months ago702 views
2 Answers
0
Accepted Answer

The issue with this seems to be coming from changes to the trigger not propagating through the system. I found an answer here. The steps I now take to get the trigger to work are:

  1. Add the S3 Trigger event with the correct prefix
  2. Refresh both the Lambda page and S3 Bucket page
  3. In the Lambda, navigate to the Code tab and select test to run a test of the lambda function and generate a cloudwatch log.
  4. Check the cloudwatch logs and confirm the test run went through

Once you have done this, you can add a test file to your bucket with the prefix and confirm everything is working.

Dave
answered 4 months ago
profile picture
EXPERT
reviewed a month ago
0

Strangely, I have been able to sometimes get the trigger to work when changing the prrefix. For instance I attempted:

"datasets/Combined/"

Which correctly triggered, but this level up allows for too many files to trigger this lambda. I adjusted back to:

"datasets/Combined/1. Raw/Demo/"

which continued to fail. I thought this may have something to do with the space in the directory "1. Raw", but when I attempted to move back to "datasets/Combined/" the trigger no longer worked. It is still unclear why this does not consistently work.

Dave
answered 4 months ago

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