Configuring Lifecycle event notifications - Amazon Simple Storage Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Configuring Lifecycle event notifications

You can set up an Amazon S3 event notification to receive notice when Amazon S3 deletes an object or transitions it to another Amazon S3 storage class following an S3 Lifecycle rule.

By using the LifecycleExpiration event types you can receive notifications wheneverAmazon S3 deletes an object based on your S3 Lifecycle configuration. The s3:LifecycleExpiration:Delete event type notifies you when an object in an unversioned bucket is deleted. It also notifies you when an object version is permanently deleted by an S3 Lifecycle configuration. The s3:LifecycleExpiration:DeleteMarkerCreated event type notifies you when S3 Lifecycle creates a delete marker when a current version of an object in versioned bucket is deleted. For more information, see Delete object version.

By using the s3:LifecycleTransition event type, you can receive notification when an object is transitioned from one Amazon S3 storage class to another by an S3 Lifecycle configuration.

Amazon S3 can publish event notifications to an Amazon Simple Notification Service (Amazon SNS) topic, an Amazon Simple Queue Service (Amazon SQS) queue, or an Amazon Lambda function. For more information, see Amazon S3 Event Notifications.

For instructions on how to configure Amazon S3 Event Notifications, see Enabling event notifications.

The following is an example of a message Amazon S3 sends to publish an s3:LifecycleExpiration:Delete event. For more information, see Event message structure.

{ "Records":[ { "eventVersion":"2.3", "eventSource":"aws:s3", "awsRegion":"us-west-2", "eventTime":"1970-01-01T00:00:00.000Z", "eventName":"LifecycleExpiration:Delete", "userIdentity":{ "principalId":"" }, "requestParameters":{ "sourceIPAddress":"" }, "responseElements":{ "x-amz-request-id":"C3D13FE58DE4C810", "x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" }, "s3":{ "s3SchemaVersion":"1.0", "configurationId":"testConfigRule", "bucket":{ "name":"mybucket", "ownerIdentity":{ "principalId":"A3NL1KOZZKExample" }, "arn":"arn:aws-cn:s3:::mybucket" }, "object":{ "key":"expiration/delete", "sequencer":"0055AED6DCD90281E5", } } } ] }

Messages that Amazon S3 sends to publish an s3:LifecycleTransition event also includes the following information.

"lifecycleEventData":{ "transitionEventData": { "destinationStorageClass": the destination storage class for the object } }