# 错误：S3存储桶通知配置无效：未找到Lambda函数ARN

- **ID:** `cloud/aws-lambda-s3-event-trigger-missing`
- **领域:** cloud
- **类别:** config_error
- **错误码:** `InvalidArgument`
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

S3事件通知中指定的Lambda函数不存在或已被删除，导致通知配置验证失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| AWS Lambda (all runtimes) | active | — | — |
| S3 (all regions) | active | — | — |

## 解决方案

1. ```
   Verify the Lambda function exists: `aws lambda get-function --function-name my-function`. If it exists, get its ARN: `aws lambda get-function-configuration --function-name my-function --query FunctionArn`. Then update the S3 notification with the correct ARN: `aws s3api put-bucket-notification-configuration --bucket my-bucket --notification-configuration file://notification.json` where notification.json contains the correct Lambda ARN.
   ```
2. ```
   If the function was deleted, recreate it with the same name and ARN. Or update the notification to point to a different existing function.
   ```

## 无效尝试

- **Recreate the S3 bucket and re-add notification** — The bucket is not the issue; the Lambda function ARN is invalid. Recreating the bucket is unnecessary. (90% 失败率)
- **Update the Lambda function with the same name** — The function may need a different ARN format (e.g., including alias or version). Simply updating does not fix the ARN mismatch. (70% 失败率)
