Bitzu

Associate Cloud Engineer ยท Managing Cloud Storage and encryption keys

What is a Cloud Storage lifecycle rule?

Lifecycle rules: conditions (age, storage class, versions) and actions (SetStorageClass, Delete), applying a JSON config with gcloud, rule timing.

Key points

  • A rule on a bucket that pairs conditions (such as age, matchesStorageClass, numNewerVersions) with an action (SetStorageClass or Delete).
  • An object must meet all conditions of a rule.
  • Rules are applied from a JSON file with gcloud storage buckets update --lifecycle-file, and actions run asynchronously, so timing is not exact.

Source: https://docs.cloud.google.com/storage/docs/lifecycle

Practice questions

Single choice

Which lifecycle action moves an object to a colder storage class?

  1. Delete
  2. SetStorageClass
  3. AbortIncompleteMultipartUpload
  4. Rewrite
Show answer

Answer: B. SetStorageClass

SetStorageClass changes the class. Delete removes the object, and AbortIncompleteMultipartUpload cleans up unfinished uploads.

Select all that apply

Which of these are valid lifecycle rule conditions?

  1. age
  2. contentType
  3. numNewerVersions
  4. uploaderEmail
  5. matchesStorageClass
Show answer

Answer: A. age, C. numNewerVersions, E. matchesStorageClass

age, numNewerVersions and matchesStorageClass are real conditions. Lifecycle rules cannot filter on content type or on the identity of the uploader.

True or false

True or false: a lifecycle action runs at the exact moment an object meets the rule's conditions.

Show answer

Answer: False

False. Actions run asynchronously, so there can be a delay, and configuration changes may take up to 24 hours to take effect.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module