Time required: 1 Hours
In this lab, we are going to learn how to use Amazon S3 lifecycle policies for object management. Lifecycle policies allow us to define rules which apply to the bucket objects, and objects located in the different subfolders (namespaces) within the bucket.
Removing Log files:
Applications can sometimes store a lot of log files. To not risk filling up your server's file system, you decide to write your log files to S3, which allows for unlimited amounts of storage. However, you need to remove log files after a couple of days because they are no longer needed. To accomplish this, you will need to setup an "Expire" lifecycle policy that applies to a subfolder named "temp/" in your bucket.
Your companies accounting department has a backup and archiving policy for financial documents. All newly added documents (objects to the bucket) need to be readily available as a backup for several days. After that period, the documents can be sent to Glacier for archiving. To automate this process, we will need to setup a lifecycle policy to send objects added to the archive/ subfolder in your bucket to Glacier after a specified number of days.