S3 Lifecycle and Management

Introduction
 
In this blog, we are going to discuss S3 lifecycle and management. Regardless of the Storage Class, objects are accessible through the S3 API and other S3 tools. Lifecycle Management allows you to define time-based rules that can trigger Transition (changing the Storage Class to Glacier) and Expiration (deletion of objects).
 
Step 1 
 
Go to the AWS management console and click the S3 option under the storage section and create the bucket. Please check the below snapshot.
 
 
 
Step 2 
 
Go to bucket properties by clicking on the bucket name and select the management tab. Here we can see to add a life cycle rule button. Click on that button. Please check the below snapshot.
  
 
 
 
Step 3
Let's create the life cycle rule for a bucket. please check the below snapshot where we have 4 sections, name and scope, transitions, expiration, and review.
 
In the first section, we need to mention the life cycle rule name and tags names. Please check the below snapshot.
 
 
 
The next section is the transition. Here, we can add a transition for current and previous versions of the bucket. Let's do a transition for our current version. We're going to say from S3 normal S3 after the object is created, we're going to transition to standard infrequently access after 30 days, then we're going to transition from standard infrequently access to Glacier after 60 days. Then in here, we have our previous versions of our objects. So we're going to add in transition and do exactly the same. 60 and 30 for these two different tiers. Go ahead and hit next. Please check the below snapshot.
 
 
 
The next step is the expiration. Here we can set an expiration period for the current and previous versions of the objects. We might want to do that 425 days from the date of which the object was created. For previous versions, we're going to permanently delete a previous version after 425 days. You can also click in here to clean up multiple incomplete multipart uploads. This is when you're uploading a file in multiple parts and you split it up and it will actually upload faster. But sometimes, files don't upload correctly. If you click clean up incomplete multipart uploads, it will basically go in after seven days from the start of the upload and delete those files. So let's go ahead and hit next. Please check the below snapshot.
 
 
 
 
The next step is the review, just verify once and hit the save button. Please check the below snapshot.
 
 
 
We have created life cycle rules for the bucket. Please check the below snapshot for confirmation.
 
 
 
Key Points To Remember:
  • Lifecycle Management can be applied to both current and previous versions.
  • Transition to Standard Infrequent Access storage class (after 30 days of creation date).
  • Transition to Glacier storage class (after 60 days of creation date).
  • It can also delete the objects permanently.
Summary
 
In this blog, we learned about the AWS S3 bucket life cycle policy. I hope that you find it helpful.
Eat->Code->Sleep->Repeat.