A financial analytics company needs to configure an existing Cloud Storage bucket named `fin-transactions-cold-2026` located in `europe-west3` to hold archived transaction logs for compliance. The compliance policy mandates that objects must be locked for a retention duration of 7 years ( seconds) and per-object Access Control Lists (ACLs) must be completely disabled to enforce unified Access Control through IAM roles across the bucket. Which `gcloud storage` command correctly applies both the 7-year retention policy and enforces uniform bucket-level access?
- gcloud storage buckets update gs://fin-transactions-cold-2026 --retention-period=220752000s --uniform-bucket-level-accessAnswer
- Bgsutil retention set 7y gs://fin-transactions-cold-2026 && gsutil uniformbucketlevelaccess set on gs://fin-transactions-cold-2026
- Cgcloud storage buckets update gs://fin-transactions-cold-2026 --default-storage-class=archive --no-uniform-bucket-level-access
- Dgcloud storage objects update gs://fin-transactions-cold-2026/* --retention-period=220752000s --grant-roles=roles/storage.objectAdmin
Answer
The command 'gcloud storage buckets update gs://fin-transactions-cold-2026 --retention-period=220752000s --uniform-bucket-level-access' correctly configures both compliance locking and bucket-level security controls.
The correct command utilizes `gcloud storage buckets update` to simultaneously configure the retention period ( seconds, corresponding to 7 years) and enable `--uniform-bucket-level-access`. This enforces compliance locking and ensures object access is governed strictly by IAM roles rather than legacy object ACLs.
Step-by-Step Solution
Key Concept
Cloud Storage Bucket Configuration and Security Policies via gcloud storage CLI
Estimated Time:2m 0s