Some objects that you store in an Amazon S3 bucket might have well-defined lifetimes. For example, you might upload logs periodically to your bucket, and you might need to retain those logs for only a specific amount of time. You can use the Object Lifecycle Management to specify a lifetime for objects in your bucket; when the lifetime of an object expires, Amazon S3 queues the object for permanent removal or logical deletion depending on your bucket's versioning state.
Amazon S3 provides an
Expiration action that you can specify in your
lifecycle configuration to expire objects. In addition, for version-enabled buckets,
Amazon S3 also provides the
NoncurrentVersionExpiration action to expire noncurrent
versions of objects.
If the bucket is nonversioned, the
Expiration action results in
Amazon S3 permanently removing the object.
If you have server access logging enabled, Amazon S3 reports the permanent removal as operation "S3.EXPIRE.OBJECT" in the log record. For more information, see Server Access Logging.
If the bucket is versioning-enabled (or versioning is suspended), the
Expiration action logically deletes the current version by
adding a delete maker as the new current version. The
NoncurrentVersionExpiration action permanently removes the
If you have server access logging enabled, Amazon S3 reports the logical deletion as operation "S3.CREATE.DELETEMARKER" and permanent deletion as operation "S3.EXPIRE.OBJECT" in the log record.
When an object reaches the end of its lifetime, Amazon S3 queues it for removal and removes it asynchronously. There may be a lag between the expiration date and the date at which Amazon S3 removes an object. You are not charged for storage time associated with an object that has expired.
To find when an object is scheduled to expire, you can use the GET Object or the HEAD Object APIs. These APIs return response headers that provide object expiration information. For more information, go to HEAD Object and GET Object in the Amazon Simple Storage Service API Reference.
For examples, see Object Lifecycle Management.