S3 Lifecycle Management

Lifecycle Management provides the option to manage the lifecyle of S3 objects, for example, the storage class can be changed automatically from Standard to Standard_IA after 30 days or the objects can be moved to Glacier or the objects can be deleted. The tasks performed by the Lifecycle Management can be classified as

  • Transition actions: automatic changing of storage classes based on user's selection.
  • Expiration actions: automatic deletion of objects based on expiration date/time set by the user

Benefits of Lifecycle Management

Lifecycle Management provides ability to automatically move objects to cheaper storage or to store objects permanently in Glacier when these are no longer required based on time criteria. For example certain types of files can only be important and processed during the initial creation of the files and after a while are no longer required and archived only.

Another scenario could be to store the log files from different operations and performing analysis on these log files initially and after a while these can be archived or deleted.

Configuring Lifecycle

Lifecycle policy can be configured from the S3 console by navigating to "Lifecycle" section under "Management" tab. Simply highlight the bucket name, click on Management section on the right hand side and then the "Lifecycle" screen will appear. Alternatively, click on the bucket name, and a screen will appear with option to click on "Management" tab at the top.



To create a lifecycle rule, click on the "Add lifecycle rule" button. Then there will be a prompt to specify the rule name and also the specify either the prefix or the tags for the objects to apply the rule on. Leave this option empty to apply the rule to all objects. Note that multiple prefixes and tags can be selected to apply the rule to.



Click Next and then option will appear to configure the rule for current and / or previous versions of the objects. Select the option depending on the case. In this example, the current version option is selected but there is not much difference in selecting the previous version.



In the above setting, objects are transitioned to Standard_IA after 30 days - 30 days is the minimum before transition can take place. The objects are then transitioned to Glacier after 60 days - 60 days is the minimum before transition can take place. The days are calculated from the object creation data - that is, the objects will be moved to Glacier after 60 days from object creation.

Click Next and then option will appear to configure the rule to expire the objects and to permanently delete the objects. The current version of the objects can be expired and the previous versions of the objects can be deleted. For versioning enabled buckets, the expire option keeps the objects as a previous version and creates a delete marker for the current object. The option to delete the object will permanently delete the previous version of the objects and the objects cannot be retrieved.



Click Next and a summary of what has been selected will appear. Each of the options from the previous steps can be edited. Remember to click on the "Save" button to save the lifecycle rule.



The lifecycle rule will now appear on the S3 console under the Management tab for the bucket.



Note that the lifecycle rule can be edited, deleted or disabled from the Management tab.