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?