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?
- gcloud storage buckets create gs://health-analytics-export --default-storage-class=nearline --public-access-prevention --uniform-bucket-level-accessAnswer
- Bgsutil mb -c nearline -b on gs://health-analytics-export && gsutil publicaccessprevention set enforced gs://health-analytics-export
- Cgcloud storage buckets create gs://health-analytics-export --default-storage-class=nearline --public-access-prevention --no-uniform-bucket-level-access
- Dgcloud 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
Key Concept
Deploying Cloud Storage buckets with security enforcement and storage class selection via gcloud storage CLI