How do I use Systems Manager Automation to troubleshoot issues when my Amazon S3 event notification doesn't invoke a Lambda function?

2 minute read
1

My Amazon Simple Storage Service (Amazon S3) event notification doesn't invoke my AWS Lambda function. Or, I receive an error when I try to create an Amazon S3 event notification to invoke my Lambda function.

Short description

To troubleshoot issues when you send Amazon S3 event notifications to Lambda, use the AWSSupport-TroubleshootLambdaS3Event AWS Systems Manager Automation runbook. The runbook checks whether an event configuration exists for the Lambda function and Amazon S3 bucket parameter values that you enter. If an event configuration exists, then the runbook verifies that the configuration, resource policies, and permissions are correct. The runbook's output provides AWS Command Line Interface (AWS CLI) commands that allow you to add the required resource policies or permissions.

Note: If you no longer need the Amazon S3 event notification, then it's a best practice to delete the event notification.

Resolution

To use the AWSSupport-TroubleshootLambdaS3Event runbook, complete the following steps:

  1. Open the Systems Manager console.
  2. In the navigation pane, under Change Management, choose Automation.
  3. Choose Execute automation.
  4. Choose the Owned by Amazon tab, and then search for AWSSupport-TroubleshootLambdaS3Event.
  5. Select the check box for the AWSSupport-TroubleshootLambdaS3Event card, and then choose Next.
  6. In the Input parameters section, complete the following tasks:
    For AutomationAssumeRole, enter an AWS Identity and Access Management (IAM) role for the runbook to assume that includes lambda:GetPolicy and s3:GetBucketNotification permissions.
    For LambdaFunctionArn, enter the Lambda function's ARN.
    For S3BucketName, enter the Amazon S3 bucket's name.
  7. Choose Execute.

Note: If the output suggests that you validate and configure your Lambda function concurrency, then see Asynchronous invocation and Lambda function scaling.

Related information

Why doesn't my Amazon S3 event notification invoke my Lambda function?

Why do I get the error "Unable to validate the following destination configurations" when I create an Amazon S3 Event Notification?