Creating Lifecycle Policies for your Cloud Storage Bucket

Lab Details:

  1. This lab walks you through Lifecycle Policy for Cloud Storage Bucket.

  2. You will be adding a rule to delete an Object from your bucket after a certain time.

  3. Region: Multi-region

  4. Duration: 30 minutes

Note: Do not refresh the page after you click Start Lab, wait for a few seconds to get the credentials.
In case while login into Google, if it asks for verification, please enter your mobile number and verify with OTP, Don't worry this Google Account will be deleted after the lab.

What is Lifecycle Policy?

  • It is used to create rules like setting a Time to Live (TTL) for objects, or "downgrading" storage classes of objects to help save money.

  • You can add a lifecycle management configuration to a bucket. You will have to add certain conditions so once an object meets the criteria of any of the rules, Cloud Storage automatically performs a specified action on the object.

  • Here are some example use cases:

  • Adding a rule to downgrade the storage class for the objects older than 180 days to Coldline Storage.

  • Adding a rule for Deletion of objects created before Dec 01, 2020.

There are two types of actions that can be specified in a lifecycle rule. i.e. Delete or SetStorageClass

Delete: It deletes an object when the object meets the conditions specified in the lifecycle policy.

SetStorageClass: It changes the storage class of an object when a certain object meets the specified conditions in the lifecycle policy.

Note: Updates to your lifecycle configuration rules might take up to 24 hours to take effect which means rules may still perform actions based on the old setup for up to 24 hours.

For example, if you change an Age condition from 5 days to 7 days, any object which is 6 days older could get deleted by the Lifecycle rule because of the old configuration, might take up to 24hours to get updated.

Lab Tasks:

  1. Login into GCP Console.

  2. Creating a bucket.

  3. Uploading an object into your bucket.

  4. Adding permissions for your bucket.

  5. Adding lifecycle policy.



Join Whizlabs_Hands-On to Read the Rest of this Lab..and More!

Step 1 : Login to My-Account
Step 2 : Click on "Access Now" to view the course you have purchased
Step 3 : You will be taken to our Learn Management Solution (LMS) to access your Labs,Quiz and Video courses

Open Console