Question

Difficulty: MediumDeploying and Configuring Cloud Storage Buckets and Objects

A media streaming company is setting up a new web asset repository on Google Cloud to host image and stylesheet files in the us-central1 region. The cloud architecture team mandates using Google Cloud's modern CLI tools (gcloud storage) and enforcing Uniform Bucket-Level Access to ensure consistent IAM governance across all stored objects. Which set of commands correctly provisions the bucket and uploads the static files according to Google Cloud best practices?

  1. Execute gcloud storage buckets create gs://media-app-assets-2026 --location=us-central1 --uniform-bucket-level-access to provision the bucket, then execute gcloud storage cp -r ./assets/* gs://media-app-assets-2026/ to upload the static files.Answer
  2. B
    Execute gsutil mb -l us-central1 --enable-ubla gs://media-app-assets-2026 to provision the bucket, then execute gsutil cp -r ./assets/* gs://media-app-assets-2026/ to upload the static files.
  3. C
    Execute gcloud storage buckets create gs://media-app-assets-2026 --location=us-central1 to create the bucket, then execute gsutil acl ch -u AllUsers:R gs://media-app-assets-2026/* to set object permissions.
  4. D
    Execute gcloud storage buckets create gs://media-app-assets-2026 --location=us-central1 to create the bucket, then grant the primitive Owner role (roles/owner) to asset consumers to manage bucket contents.

Answer

Execute gcloud storage buckets create gs://media-app-assets-2026 --location=us-central1 --uniform-bucket-level-access to provision the bucket, then execute gcloud storage cp -r ./assets/* gs://media-app-assets-2026/ to upload the static files.
The correct response specifies using `gcloud storage buckets create` with `--location=us-central1` and `--uniform-bucket-level-access`, followed by `gcloud storage cp` to upload files. This follows Google Cloud's current best practices for bucket deployment and CLI usage.

Step-by-Step Solution

1
Select the correct command and flag to create the Cloud Storage bucket.
Use `gcloud storage buckets create` specifying `--location=us-central1` and `--uniform-bucket-level-access`.
Modern Google Cloud tooling prefers `gcloud storage` commands over `gsutil`, and `--uniform-bucket-level-access` ensures IAM-only access control.
2
Select the correct command to recursively upload static asset files.
Use `gcloud storage cp -r ./assets/* gs://media-app-assets-2026/`.
The `gcloud storage cp` command efficiently performs recursive file transfers to Cloud Storage buckets.

Key Concept

Deploying Cloud Storage Buckets with Uniform Bucket-Level Access using gcloud storage CLI
Rate this question