Menu
Amazon Simple Storage Service
Console User Guide (API Version 2006-03-01)

Enabling Event Notifications

Important

This is the User Guide for the old Amazon S3 console. If you are looking for the User Guide for the new Amazon S3 console, see Welcome to the New Amazon S3 Console User Guide.  

You can enable certain Amazon S3 bucket events to send a notification message to a destination whenever the events occur. This section explains how to use the Amazon S3 console to enable event notifications. For more information about using event notifications and how to use the Amazon S3 API to enable event notifications, see Configuring Notifications for Amazon S3 Events in the Amazon Simple Storage Service Developer Guide.

Amazon S3 can send notifications for the following events:

An object created event

You select ObjectCreated(All) when configuring your events in the console to enable notifications for anytime an object is created in your bucket. Or, you can select one or more of the specific object-creation actions to trigger event notifications. These actions are PUT, POST, Copy, and CompleteMultiPartUpload.

An object removed event

You select ObjectRemoved(All) when configuring your events in the console to enable notification for anytime an object is deleted. Or you can select Delete to trigger event notifications when an unversioned object is deleted or a versioned object is permanently deleted. Select DeleteMarkerCreated to trigger event notifications when a delete marker is created for a versioned object. For information about deleting versioned objects, see Deleting Object Versions. For information about object versioning, see Object Versioning and Using Versioning.

A Reduced Redundancy Storage (RRS) object lost event

Amazon S3 sends a notification message when it detects that an object of RRS storage class has been lost.

Event notification messages can be sent to the following types of destinations:

  • An Amazon Simple Notification Service (Amazon SNS) topic

  • An Amazon Simple Queue Service (Amazon SQS) queue

  • An AWS Lambda function

Set Up a Destination to Receive the Event Notifications

Before you can enable event notifications for your bucket you must set up one of the following destination types:

An Amazon SNS topic

You can use the Amazon SNS console to create an Amazon SNS topic that your notifications can be sent to. The Amazon SNS topic must be in the same region as your Amazon S3 bucket. For information about creating an Amazon SNS topic, see Getting Started in the Amazon Simple Notification Service Developer Guide.

Before you can use the Amazon SNS topic that you create as an event notification destination.

  • You must have the Amazon Resource Name (ARN) for the Amazon SNS topic.

  • You must have a valid Amazon SNS topic subscription. The topic subscribers are notified when a message is published to your Amazon SNS topic.

  • You must set up a permissions policy through the Amazon SNS console as shown in the following example.

    Copy
    { "Version":"2012-10-17", "Id": "__example_policy_ID", "Statement":[ { "Sid": "example-statement-ID", "Effect":"Allow", "Principal": "*", "Action": "SNS:Publish", "Resource":"arn:aws:sns:region:account-number:topic-name", "Condition": { "ArnEquals": { "aws:SourceArn": "arn:aws:s3:::bucket-name" } } } ] }
An Amazon SQS queue

You can use the Amazon SQS console to create an Amazon SQS queue that your notifications can be sent to. The Amazon SQS queue must be in the same region as your Amazon S3 bucket. For information about creating an Amazon SQS queue, see Getting Started with Amazon SQS in the Amazon Simple Queue Service Developer Guide.

Before you can use the Amazon SQS queue as an event notification destination.

  • You must have the Amazon Resource Name (ARN) for the Amazon SQS topic.

  • You must set up a permissions policy through the Amazon SQS console as shown in the following example.

    Copy
    { "Version":"2012-10-17", "Id": "__example_policy_ID", "Statement":[ { "Sid": "example-statement-ID", "Effect":"Allow", "Principal": "*", "Action": "SQS:*", "Resource":"arn:aws:sqs:region:account-number:queue-name", "Condition": { "ArnEquals": { "aws:SourceArn": "arn:aws:s3:::bucket-name" } } } ] }
A Lambda function

You can use the AWS Lambda console to create a Lambda function. The Lambda function must be in the same region as your S3 bucket. For information about creating a Lambda function, see the AWS Lambda Developer Guide.

Before you can use the Lambda function as an event notification destination, you must have the name or the ARN of a Lambda function to set up the Lambda function as a event notification destination.

For information about using Lambda with Amazon S3, see Using AWS Lambda: with Amazon S3 in the AWS Lambda Developer Guide.

Enable Event Notifications

The following procedure shows you how to enable event notifications for a bucket.

To enable bucket event notifications

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. In the Buckets list, click the bucket whose events you want to configure, click Properties and then click Events.

    
                Events
  3. In the Name box, type a descriptive name for your event configuration. If you do not enter a name, a GUID is autogenerated and used for the name.

  4. Click in the Events box and select the type or types of events that you want to send notifications to a destination when an event occurs.

    
                Events
  5. Select ObjectCreated(All) to enable event notifications for anytime an object is created in the bucket. Or, you can select specific object creation actions to trigger notifications. For example, you could select Put and CompleteMultiPartUpload to trigger event notifications anytime a new object is put into a bucket and anytime a multipart upload completes. (Optionally, you could select ObjectRemoved(All) to enable event notifications for anytime an object is deleted in the bucket. Or, you could select Delete or DeleteMarkeCreated to trigger notifications for specific types of object deletes.)

    You can configure notifications to be filtered by the prefix and/or suffix of the name of objects. For example, you can set up a configuration so that you are sent a notification only when files are added to an image folder (objects with the name prefix images/). For more information on filtering, see see Configuring Notifications with Object Key Name Filtering.

    
                Events
  6. Select the type of destination to have the event notifications sent to.

    
                Events
    1. If you select the SNS Topic destination type.

      1. In the SNS topic box, type the name or select from the menu, the Amazon SNS topic that will receive notifications from Amazon S3. For information about the Amazon SNS topic format, go to https://aws.amazon.com/sns/faqs/#10.

        
                        Events
      2. (Optional) You can also select Add SNS topic ARN from the menu and type the ARN of the SNS topic in the SNS topic ARN box.

        
                        Events
    2. If you select the SQS queue destination type.

      1. In the SQS queue box, type the name or select from the menu, the name of the Amazon SQS queue that will receive notifications from Amazon S3. For information about Amazon SQS, see What is Amazon Simple Queue Service? in the Amazon Simple Queue Service Developer Guide.

        
                        Events
      2. (Optional) You can also select Add SQS topic ARN from the menu and type the ARN of the SQS queue in the SQS queue ARN box.

        
                        Events
    3. If you select the Lambda Function destination type.

      1. In the Lambda Function box, type or choose the name of the Lambda function that you want to receive notifications from Amazon S3.

        
                        Events
      2. If you don't have any Lambda functions in the region that contains your bucket, you'll be prompted to enter a Lambda function ARN. In the Lambda Function ARN box, type the ARN of the Lambda function that you want to receive notifications from Amazon S3.

        
                        Events
      3. (Optional) You can also choose Add Lambda function ARN from the menu and type the ARN of the Lambda function in the Lambda function ARN box.

        
                        Events

      For information about using Lambda with Amazon S3, see Using AWS Lambda: with Amazon S3 in the AWS Lambda Developer Guide.

  7. Choose Save. Amazon S3 will send a test message to the event notification destination.

Editing and Deleting Event Notifications Configurations

After you have saved an event notifications configuration, you can edit or delete the configuration.

To edit an event notifications configuration

  1. In the Event Notifications list, click the pencil icon.

    
                Edit Event Configuration
  2. Make your changes and then click Save.

    
                Edit Event Configuration Detail

To delete an event notifications configuration

  • In the Event Notifications list, click the x icon that appears on the right side of the screen for the event notification that you want to delete and then click Save.

    
                Delete Event Configuration