Amazon Lifecycle rules helps you to manage the storage cost by controlling the lifecycle of the object using S3 storage classes. You can apply the lifecycle rules to both current and previous of an objects. You need to ensure the versioning is enable on desired bucket to benefit from full feature of lifecycle.
Lifecycle rules automatically transition your object to:
Standard Storage à Infrequent Access Storage à Archive Glacier à Permanently Delete
Quickly go to the Glacier option to see any region does not have this feature or not if you plan to archive.
Go to the AWS S3 Storage console
I have created a bucket called lifecyclemumbai and enabled versioning on it.
By default there is no lifecycle rule which is created, we will go ahead and create one. Click on add rule
Here you can select the whole bucket or subset of the bucket to apply lifecycle rule
One of the best thing here is the explanation which is done diagrammatically to understand easily. Let me elaborate for you.
· Whenever an object is created under this bucket after 30days it will get moved to infrequent access storage class
· Post 30 days after an object which is moved from standard to IA Storage class i.e. 60 days after an object is created will be moved to Glacier Storage class. The cost is quite cheap compared to standard and IA storage & end users will be facing a slight delay in accessing archived data
· You can also set an expiration (after 999 days after the object’s creation date) which retains the current version as previous version and place a delete marker as the current version. It will be still available under hide tab in the old portal. If you want to permanently delete the object enable this option with the combination of the option – action on previous version on the next slide
The only difference about the below process from previous screenshot is an object which is targeted (previous version). Unless you enable versioning feature on the bucket this option “action on previous versions” will not be available. Secondly to delete an object permanently when you select the combine expire option both on current as well as previous version.
Give the rule name and review the settings. Click on create and activate rule
We have successfully created the lifecycle and it is enabled.