0

I have an S3 bucket that should invoke a Lambda function on ObjectCreated:Put. This used to work. After editing the Lambda code in the console, new uploads stopped triggering the function. I do not see new log streams or invocations.

Setup:

Region: us-east-1 for both S3 and Lambda

Bucket: my-bucket

Event notification: ObjectCreated:Put with prefix incoming/ and suffix .json, destination is the Lambda function

Lambda: ingest_s3_put (Python 3.12, handler app.handler)

Execution role: includes AWSLambdaBasicExecutionRole for CloudWatch logs

Resource policy: allows S3 to invoke the function

Expected: uploading incoming/test.json invokes the function and writes to /aws/lambda/ingest_s3_put.

Actual: the object uploads, but the function does not run. No new CloudWatch log streams.

What I checked:

  • Recreated the S3 event notification
  • Verified S3 and Lambda are in the same region
  • Confirmed the trigger shows as Enabled on the Lambda Triggers tab
  • Verified the Lambda resource policy grants lambda:InvokeFunction to s3.amazonaws.com with the correct bucket ARN
  • Manually invoked the function with a test event. It runs.
  • Gave the function s3:GetObject to read the file
  • Uploaded multiple files that match the prefix and suffix

Is there a post-edit step or another common "pitfall" that would stop S3 from invoking Lambda after I change code in the console?

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 19 at 2:07

1 Answer 1

0

Root cause
I edited the code in the Lambda console and did not click Deploy. Saving in the editor does not make the change live for the version or alias that S3 is invoking. After I clicked Deploy, S3 events started invoking the function again.

Fix in the console

  1. Open the Lambda function.

  2. Click Deploy to publish the code change.

  3. On Configuration > Triggers, make sure the S3 trigger is Enabled.

  4. Upload a test object to the bucket and prefix.

  5. Check CloudWatch Logs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.