Setting Cloud Storage Lifecycle Rules

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

While saving an object in a Cloud Storage bucket is relatively inexpensive, there is, nonetheless, a cost. The cost varies depending on the storage class selected. Certain objects are required to be more available at first, requiring the storage class with the highest availability — and cost. Such objects may eventually be relegated to less available and less expense storage classes and even be deleted. Management of these objects over time can be handled automatically by establishing and implementing lifecycle rules. In this hands-on lab, you’ll see how to set a variety of lifecycle rules for Google Cloud Storage buckets, both from the console and the command line, as well as see how to place an object on hold so it stays in place regardless of the rules.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create and Populate the Storage Bucket

In Cloud Storage, create a bucket and add several files.

Create Lifecycle Storage Rules via the Console

Using the console, create lifecycle rules.

Update Lifecycle Rules via the CLI

From the GCP CLI, update the existing lifecycle rules using a JSON file.

Place an Item on Hold

Place an event-based hold on one item in bucket.

Additional Resources

Your entire company is looking for ways to lower expenses, and you’ve been asked to set up a series of Cloud Storage lifecycle rules for a particular bucket. These rules will move the objects within the bucket from a Standard storage class to Nearline after one month, then to Coldline after a quarter, then to Archive after a year, and finally to delete the objects after two years — with the exception of one object, which will be placed on an event-based hold. You decide to use both the console and the command line to accomplish these goals.

You can find files for this lab in the cloud-storage-lifecycle-lab folder of the lab repo.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?