download free 30 days trial version buy bucket explorer
Documentation  Download  Purchase  Support  FAQs   Forum   ScreenShots & Demos

Manage Amazon S3 Lifecycle Configuration (GET Lifecycle, PUT Lifecycle, DELETE Lifecycle)

Manage Amazon S3 Lifecycle Configuration by sending HTTP GET or PUT Requests to S3 Server

You may want to define the lifecycle of your files ( Objects ) stored on Amazon S3, by specifying certain actions that Amazon S3 should perform on seleted Objects, after a certain period of time since the creation of the Object. You can specify different rules for different object(s) in a Bucket . The process of defining such rules is called Lifecycle Configuration. For example, you may want to delete or archive certain files stored on Amazon S3 after some time.

You can manage the Lifecycle Configuration on your Amazon S3 Objects by sending HTTP GET, HTTP PUT or HTTP DELETE Requests in two ways:

  1. Manage Amazon S3 Lifecycle Configuration using S3 REST APIs (GET Lifecycle, PUT Lifecycle, DELETE Lifecycle) programmatically, if you are a software programmer- We will only discuss S3 REST APIs on this website. Please refer to AWS S3 Documentation to get more details on SOAP APIs.
  2. Configure Lifecycle of Amazon S3 Objects using Bucket Explorer, which provides an easy interface and you do not need to write a program to Configure S3 Objects Lifecycle.

The following sections on this page describe how you can use Amazon S3 APIs in your program or how you can use Bucket Explorer for Lifecycle Configuration of your S3 files.

Add Object Lifecycle Configuration using Amazon S3 REST API (PUT Lifecycle)

To add Object Lifecycle Configuration on an Amazon S3 Bucket, you will need to request PUT Lifecycle Request. For that you will require to pass Bucket Name and lifecycle configuration as shown in the sample below, in the body of the request.

Syntax:


PUT /?lifecycle HTTP/1.1
Host: bucketname .s3.amazonaws.com
Content-Length: length
Date: date
Authorization: signatureValue
Content-MD5: MD5

Lifecycle configuration in the request body
 

Get Object Lifecycle Configuration using Amazon S3 REST API (GET Lifecycle)

To access the details about Lifecycle configured on your bucket, send GET request to return the lifecycle configuration information:

Syntax:


GET /?lifecycle HTTP/1.1
Host: bucketname .s3.amazonaws.com
Date: date
Authorization: signatureValue
 

Add Object Lifecycle Configuration using Bucket Explorer

While the "PUT Lifecycle" Amazon S3 REST API allows you to add object lifecycle to the bucket by writing code, Bucket Explorer lets you do that with mouse clicks:

Steps to add Object Lifecycle Configuration:

  1. Connect to your AWS S3 Account using Bucket Explorer.
  2. Select the S3 Bucket from bucket table.
  3. Go To Advanced -> Object Lifecycle -> Set Object Lifecycle
  4. Add Rule one by one. Each Rule contains
    • Prefix : You can add prefix or leave empty this field (if rule want to apply for the bucket)
    • Action (Transition / Expiration) : You can either apply any one or both action for the rule.
    • Date/Time : Each Action will be applied at the specific time.
    • Enable Rule : You can add 1000 rules and set enable/disable individual rule you want.
  5. Finally Apply the setting.

Remove Object Lifecycle Configuration using Amazon S3 REST API (DELETE Lifecycle)

To remove Object Lifecycle Configuration on the Bucket, you can request DELETE Lifecycle Request. For that you need to have a Bucket Name.

Syntax:


DELETE /?lifecycle HTTP/1.1
Host: bucketname .s3.amazonaws.com
Date: currentdate
Authorization: signatureValue
 

Remove Object Lifecycle Configuration using Bucket Explorer

While the "DELETE Lifecycle" API of AWS allows you to remove object lifecycle to the bucket by writing code, Bucket Explorer lets you do that  without writing a single line of code.

Steps to Remove Object Lifecycle Configuration:

  1. Connect to your AWS S3 Account using Bucket Explorer.
  2. Select the S3 Bucket from bucket table.
  3. Go To Advanced -> Object Lifecycle -> Remove Object Lifecycle
  4. It will prompt you to remove the object lifecycle configuration if it exists.
  5. Finally you will get successfully remove the object lifecycle configuration message.