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?
- 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`.
- 2Apply the retention policy to the bucket using `gcloud storage buckets update gs://finsec-audit-logs-2026 --retention-period=365d`.
- 3Draft a local JSON file (`lifecycle.json`) containing a `SetStorageClass` action set to `ARCHIVE` for objects matching an age condition of 90 days.
- 4Attach the lifecycle configuration to the bucket using `gcloud storage buckets update gs://finsec-audit-logs-2026 --lifecycle-file=lifecycle.json`.
- 5Upload the historical log files to the destination path using `gcloud storage cp *.log gs://finsec-audit-logs-2026/logs/`.
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
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.