Question

Difficulty: Very hardDeploying and Configuring Cloud Storage Buckets and Objects

A cloud administrator is tasked with setting up a highly compliant log storage architecture on Google Cloud using modern `gcloud storage` CLI utilities. The solution requires creating a bucket with uniform bucket-level access enabled, setting a 365-day retention policy, defining and attaching a lifecycle policy to automatically transition objects to ARCHIVE storage after 90 days, and finally populating the bucket with historical log files. In what exact sequential order should the administrator perform these operations?

  1. 1Create the bucket with Uniform Bucket-Level Access enabled using `gcloud storage buckets create gs://finsec-audit-logs-2026 --location=us-east1 --uniform-bucket-level-access`.
  2. 2Apply the retention policy to the bucket using `gcloud storage buckets update gs://finsec-audit-logs-2026 --retention-period=365d`.
  3. 3Draft a local JSON file (`lifecycle.json`) containing a `SetStorageClass` action set to `ARCHIVE` for objects matching an age condition of 90 days.
  4. 4Attach the lifecycle configuration to the bucket using `gcloud storage buckets update gs://finsec-audit-logs-2026 --lifecycle-file=lifecycle.json`.
  5. 5Upload the historical log files to the destination path using `gcloud storage cp *.log gs://finsec-audit-logs-2026/logs/`.

Answer

The correct operational sequence is: first, create the bucket with Uniform Bucket-Level Access; second, set the 365-day retention policy on the bucket; third, construct the local lifecycle JSON file; fourth, attach the lifecycle JSON file to the bucket using gcloud storage buckets update; and fifth, copy the historical log files into the bucket.
The deployment sequence follows proper dependency order: creating the Cloud Storage bucket resource with Uniform Bucket-Level Access, configuring bucket-level compliance retention settings, drafting the local lifecycle configuration JSON file, updating the bucket to apply the lifecycle configuration file, and finally copying log files into the configured bucket.

Step-by-Step Solution

1
Execute `gcloud storage buckets create` with `--uniform-bucket-level-access`.
The destination bucket is provisioned with uniform IAM access control enforcement.
Resource creation must precede configuration modifications or data population.
2
Execute `gcloud storage buckets update` with `--retention-period=365d`.
The bucket retention governance policy is established.
Configuring compliance retention settings prior to populating objects ensures all stored data is bound by the policy from the moment of ingestion.
3
Draft the local `lifecycle.json` file defining an age-based condition (90 days) and `SetStorageClass` action (`ARCHIVE`).
A valid local lifecycle definition document is created.
The lifecycle rule document must exist locally before it can be referenced in a `gcloud` update command.
4
Execute `gcloud storage buckets update` with `--lifecycle-file=lifecycle.json`.
The lifecycle policy is bound to the Cloud Storage bucket.
Attaching the policy activates automated object transition rules on the bucket.
5
Execute `gcloud storage cp` to transfer the local log files into the bucket path.
Objects are securely written into the fully configured and governed bucket.
Object upload is the final deployment step.

Key Concept

Deploying and configuring Google Cloud Storage buckets requires establishing underlying bucket resources and security policies prior to deploying lifecycle rules and ingesting data via modern `gcloud storage` CLI commands.
Rate this question