InvalidArgument cloud config_error ai_generated true

Error: S3 bucket notification configuration is invalid: Lambda function ARN not found

ID: cloud/aws-lambda-s3-event-trigger-missing

Also available as: JSON · Markdown · 中文
95%Fix Rate
86%Confidence
1Evidence
2023-11-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
AWS Lambda (all runtimes) active
S3 (all regions) active

Root Cause

The Lambda function specified in the S3 event notification does not exist or has been deleted, causing the notification configuration to fail validation.

generic

中文

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

Official Documentation

https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-event-types-and-destinations.html

Workarounds

  1. 95% success 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.
    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. 90% success If the function was deleted, recreate it with the same name and ARN. Or update the notification to point to a different existing function.
    If the function was deleted, recreate it with the same name and ARN. Or update the notification to point to a different existing function.

中文步骤

  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.

Dead Ends

Common approaches that don't work:

  1. Recreate the S3 bucket and re-add notification 90% fail

    The bucket is not the issue; the Lambda function ARN is invalid. Recreating the bucket is unnecessary.

  2. Update the Lambda function with the same name 70% fail

    The function may need a different ARN format (e.g., including alias or version). Simply updating does not fix the ARN mismatch.