Question

Difficulty: Very hardDeploying and Configuring Cloud Storage Buckets and Objects

A cloud engineer is deploying a Cloud Storage bucket named `health-analytics-export` to ingest sensitive patient telemetry files that will be accessed occasionally each month. Organization security policy strictly requires that per-object ACLs be disabled in favor of unified IAM management, and that public access to the bucket be explicitly prohibited at the bucket level. Additionally, the bucket must be configured with a default storage class optimized for data accessed at most once a month to minimize storage costs. Which `gcloud storage` CLI command correctly creates the bucket according to Google Cloud best practices?

  1. gcloud storage buckets create gs://health-analytics-export --default-storage-class=nearline --public-access-prevention --uniform-bucket-level-accessAnswer
  2. B
    gsutil mb -c nearline -b on gs://health-analytics-export && gsutil publicaccessprevention set enforced gs://health-analytics-export
  3. C
    gcloud storage buckets create gs://health-analytics-export --default-storage-class=nearline --public-access-prevention --no-uniform-bucket-level-access
  4. D
    gcloud storage buckets create gs://health-analytics-export --default-storage-class=archive --public-access-prevention --uniform-bucket-level-access

Answer

The command 'gcloud storage buckets create gs://health-analytics-export --default-storage-class=nearline --public-access-prevention --uniform-bucket-level-access' is correct because it utilizes the modern gcloud storage CLI to satisfy all operational, access control, and storage tier requirements.
The correct command uses 'gcloud storage buckets create' with '--default-storage-class=nearline' to accommodate monthly access patterns cost-effectively, alongside '--uniform-bucket-level-access' to enforce IAM-only access controls and '--public-access-prevention' to block public internet access.

Step-by-Step Solution

1
Identify the primary tool recommendation
Use 'gcloud storage buckets create' instead of legacy 'gsutil mb' commands.
Google Cloud recommends using the gcloud storage CLI for all object and bucket operations.
2
Determine the appropriate storage class
Select Nearline storage class using '--default-storage-class=nearline'.
Data accessed once per month fits the Nearline storage class profile, avoiding the higher retrieval costs of Coldline or Archive classes.
3
Configure security and access controls
Enable '--uniform-bucket-level-access' and '--public-access-prevention'.
Uniform Bucket-Level Access disables individual object ACLs in favor of IAM, while Public Access Prevention prevents accidental public exposure.

Key Concept

Deploying Cloud Storage buckets with security enforcement and storage class selection via gcloud storage CLI
Rate this question