Manage Cloud Storage Lifecycle Policy using gsutil (Solution)

Manage Cloud Storage Lifecycle Policy using gsutil (Solution)

Overview

  • Labs are timed and cannot be paused. The timer starts when you click Start Lab.

  • The included cloud terminal is preconfigured with the gcloud SDK.

  • Use the terminal to execute commands and then click Check my progress to verify your work.

Challenge scenario

You are managing a Cloud Storage bucket named qwiklabs-gcp-00-69b7a025cab7-bucket. This bucket serves multiple purposes within your organization and contains a mix of active project files, archived documents, and temporary logs. To optimize storage costs, you need to implement a lifecycle management policy that automatically aligns the storage classes of these files with their access patterns.

  • Design a lifecycle management policy with the following objectives:

    • Active Project Files: Files within the /projects/active/ folder modified within the last 30 days should reside in Standard storage for fast access.

    • Archives: Files within /archive/ modified within the last 90 days should be moved to Nearline storage. After 180 days, they should transition to Coldline storage.

    • Temporary Logs: Files within /processing/temp_logs/ should be automatically deleted after 7 days.

Click Check my progress to verify the objective.


Solution of Lab