# Missing S3 event notification for Lambda trigger: S3 bucket 'my-bucket' has no event notification configuration for Lambda function 'my-function'

- **ID:** `cloud/aws-lambda-s3-event-source-missing-notification`
- **Domain:** cloud
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

The S3 bucket does not have an event notification configured to invoke the Lambda function, often due to manual deletion of the notification or incorrect bucket policy.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| aws_cli | active | — | — |
| lambda_runtime | active | — | — |
| s3 | active | — | — |

## Workarounds

1. **Use AWS CLI to add the event notification: `aws s3api put-bucket-notification-configuration --bucket my-bucket --notification-configuration file://config.json` where config.json contains: `{"LambdaFunctionConfigurations": [{"LambdaFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-function", "Events": ["s3:ObjectCreated:*"]}]}`** (95% success)
   ```
   Use AWS CLI to add the event notification: `aws s3api put-bucket-notification-configuration --bucket my-bucket --notification-configuration file://config.json` where config.json contains: `{"LambdaFunctionConfigurations": [{"LambdaFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-function", "Events": ["s3:ObjectCreated:*"]}]}`
   ```
2. **Check and update the Lambda resource-based policy to allow S3 invoke: `aws lambda add-permission --function-name my-function --statement-id s3-invoke --action lambda:InvokeFunction --principal s3.amazonaws.com --source-arn arn:aws:s3:::my-bucket`** (85% success)
   ```
   Check and update the Lambda resource-based policy to allow S3 invoke: `aws lambda add-permission --function-name my-function --statement-id s3-invoke --action lambda:InvokeFunction --principal s3.amazonaws.com --source-arn arn:aws:s3:::my-bucket`
   ```

## Dead Ends

- **** — The console may not create the notification if the bucket already has a notification limit (max 100) or if permissions are insufficient. (50% fail)
- **** — The bucket policy is independent of event notifications; the notification itself must be configured via S3 API. (80% fail)
