Menu
Amazon Simple Storage Service
Console User Guide

How Do I Enable and Configure Event Notifications for an S3 Bucket?

If you are in the old Amazon S3 console, to use the new console, choose Opt In in the following box, which appears on the old Amazon S3 console home page. Note that Opt In is not available in all Regions.  


                            Opt-in to new Amazon S3 console UI

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 , 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 choose 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 delete event – You select ObjectDelete (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. You select Delete Marker Created to trigger event notifications when a delete marker is created for a versioned object.

  • A Reduced Redundancy Storage (RRS) object lost event – You select RRSObjectLost to be notified when Amazon S3 detects that an object of the 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 – A web service that coordinates and manages the delivery or sending of messages to subscribing endpoints or clients.

  • An Amazon Simple Queue Service (Amazon SQS) queue – Offers reliable and scalable hosted queues for storing messages as they travel between computer.

  • A Lambda function – AWS Lambda is a compute service where you can upload your code and the service can run the code on your behalf using the AWS infrastructure. You package up and upload your custom code to AWS Lambda when you create a Lambda function

Before you can enable event notifications for your bucket you must set up one of these destination types. For more information, see How Do I Set Up a Destination to Receive Event Notifications?.

To enable and configure event notifications for an S3 bucket

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

  2. In the Bucket name list, choose the name of the bucket that you want to enable events for.

  3. Choose Properties.

  4. Under Advanced settings, choose Events.

  5. Choose Add notification.

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

  7. Under Events, select one or more of the type of event occurrences that you want to receive notifications for. When the event occurs a notification is sent to a destination that you choose. For example, you could do any of the following:

    • Select ObjectCreate (All) to enable event notifications for anytime an object is created in the bucket.

    • Select Put and Complete MultipartUpload to trigger event notifications anytime a new object is put into a bucket and anytime a multipart upload completes.

    • Select ObjectDelete (All) to enable event notifications for anytime an object is deleted in the bucket.

    • Select Delete or Delete Marker Created to trigger notifications for specific types of object deletes.

    For information about deleting versioned objects, see Deleting Object Versions. For information about object versioning, see Object Versioning and Using Versioning.

    Note

    When you delete the last object from a folder Amazon S3 can generate an object creation event. The Amazon S3 console displays a folder under the following circumstances: 1) when a zero byte object has a trailing slash (/) in its name (in this case there is an actual Amazon S3 object of 0 bytes that represents a folder), and 2) if the object has a slash (/) within its name (in this case there isn't an actual object representing the folder). When there are multiple objects with the same prefix with a trailing slash (/) as part of their names, those objects are shown as being part of a folder. The name of the folder is formed from the characters preceding the trailing slash (/). When you delete all the objects listed under that folder, there is no actual object available to represent the empty folder. Under such circumstance the Amazon S3 console creates a zero byte object to represent that folder. If you enabled event notification for creation of objects, the zero byte object creation action that is taken by the console will trigger an object creation event.

  8. Type an object name Prefix and/or a Suffix to filter the event notifications by the prefix and/or suffix. For example, you can set up a filter so that you are sent a notification only when files are added to an image folder (for example, objects with the name prefix images/). For more information, see Configuring Notifications with Object Key Name Filtering.

    
            Events

  9. 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, see SNS FAQ.

        
                    Events

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

        
                    Events

    2. If you select the SQS queue destination type, do the following:

      1. In SQS queue, type or choose a name from the menu of the Amazon SQS queue that you want to 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.

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

    3. If you select the Lambda Function destination type, do the following:

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

      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 Lambda Function ARN, type the ARN of the Lambda function that you want to receive notifications from Amazon S3.

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

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

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