S3 Object Life Cycle policy

Rahul Venati
3 min readSep 30, 2019

--

Image Credits : https://icon-library.net

This article is part of S3 Series if you never worked with S3 or new to it I highly recommend to check previous articles. Links are shared below

Object Life Cycle Policy:

Object Life Cycle policy is used to move the objects in your bucket from one storage class to another automatically. Let’s say we have objects in our bucket which are stored in Standard Storage.

  • Now we have to move those files from Standard Storage to Infrequent Access Storage after 60 days of creation
  • After 120 days we have to move those files from Infrequent Access Storage to Glacier.

Now in order to implement the above statements

  • You have to log in to AWS and navigate to S3, choose the bucket you want to implement object life cycle rules.
  • Now you can add new life cycle rules under the management section.
  • Click on Add life cycle rules it will open a new window
Adding New Life Cycle Rules
  • The first step adding life cycle rule is giving a name to it and adding prefix or tags if required.
Naming The Life Cycle Rule
  • The second step is transitioning that is adding our life cycle rules here
  • We have to select which version of files we need to add these life cycle rules. Is it only for the current version or previous version will see what is versioning in upcoming article. Here I am choosing only the current version of files.
  • Now we have to add transition and enter our rules for how many days we have to move the files to different storage classes.
  • Here we are moving the files from Standard storage to Infrequent Access Storage after 60 days and to glacier after 120 days of creation
Adding Rules in Object Life Cycle Policies
  • In the next step, we can set the expiration of our objects that is after how many days of creation the objects have to be expired.
  • We are deleting all the files after 485 days of creation.
  • In S3 we can upload a large file in multiple small parts sometimes few small files uploading might fail. We can delete those failed uploads. Here we are deleting those files for every 7 days.
Setting up Expiration in life cycle policies

Now in the next step just review the options and create an object policy and you can see created life cycle policy under the management section in your bucket.

Created Life Cycle Policy

That's all about Object Life Cycle Policies and will learn about a few more S3 properties in upcoming articles.

--

--

Rahul Venati

EdTech Enthusiast | Learning and Blogging about New Tech