Question

Difficulty: MediumDeploying and Configuring Cloud Storage Buckets and Objects

A cloud administrator is configuring a newly created Google Cloud Storage bucket named `analytics-export-data` to align with organizational security and operational compliance standards. The organization mandates that access must be managed strictly using IAM roles at the bucket level rather than per-object Access Control Lists (ACLs). Additionally, log files uploaded to this bucket must automatically transition to Nearline storage after 90 days to minimize ongoing storage fees. Which of the following commands should the administrator execute using the `gcloud` CLI to satisfy these requirements? (Select TWO.)

  1. Execute `gcloud storage buckets update gs://analytics-export-data --enable-uniform-bucket-level-access` to disable per-object ACLs and enforce bucket-level IAM policies.Answer
  2. Execute `gcloud storage buckets update gs://analytics-export-data --lifecycle-file=lifecycle.json` where `lifecycle.json` defines a rule to change the storage class to Nearline for objects older than 90 days.Answer
  3. C
    Execute `gsutil acl set private gs://analytics-export-data` to enforce uniform access control across all bucket objects.
  4. D
    Execute `gcloud storage objects update gs://analytics-export-data/* --storage-class=NEARLINE --age=90` to transition objects daily.

Answer

The administrator must enable uniform bucket-level access using `gcloud storage buckets update gs://analytics-export-data --enable-uniform-bucket-level-access` and set the object lifecycle policy using `gcloud storage buckets update gs://analytics-export-data --lifecycle-file=lifecycle.json`.
To satisfy security and lifecycle requirements using modern GCP CLI standards, the administrator must enable Uniform Bucket-Level Access on the bucket resource to enforce IAM policy evaluation and apply a JSON lifecycle policy file using `gcloud storage buckets update --lifecycle-file` to automate the transition of 90-day-old objects to Nearline storage.

Step-by-Step Solution

1
Enforce bucket-level access control
Disables per-object ACLs on the bucket and relies exclusively on Google Cloud IAM permissions.
Uniform Bucket-Level Access unifies access management under IAM and satisfies the organizational requirement to prevent per-object ACL usage.
2
Configure object lifecycle rules for cost optimization
Applies a lifecycle policy file to the bucket containing a SetStorageClass action targeting Nearline storage for objects with age greater than 90 days.
Bucket-level lifecycle rules continuously inspect object ages and automatically transition storage classes without manual intervention or invalid object-update flags.

Key Concept

Cloud Storage bucket configuration using modern gcloud CLI flags for Uniform Bucket-Level Access and Object Lifecycle Management.
Estimated Time:1m 30s
Rate this question