Question

Difficulty: MediumDeploying and Configuring Cloud Storage Buckets and Objects

A cloud engineer needs to create a new Google Cloud Storage bucket named `customer-backups-us-central1` located in the `us-central1` region using the modern `gcloud` CLI. The bucket must be configured with a default storage class of `NEARLINE` for storing monthly database backups. Which command should the engineer execute to fulfill these requirements?

  1. gcloud storage buckets create gs://customer-backups-us-central1 --location=us-central1 --default-storage-class=NEARLINEAnswer
  2. B
    gsutil mb -c NEARLINE -l us-central1 gs://customer-backups-us-central1
  3. C
    gcloud storage buckets create gs://customer-backups-us-central1 --region=us-central1 --storage-class=NEARLINE
  4. D
    gcloud storage buckets create gs://customer-backups-us-central1 --location=us-central1 --default-storage-class=COLDLINE

Answer

The command 'gcloud storage buckets create gs://customer-backups-us-central1 --location=us-central1 --default-storage-class=NEARLINE' correctly creates the bucket with the required location and storage class using modern gcloud storage syntax.
The correct command utilizes 'gcloud storage buckets create' followed by the bucket URI 'gs://customer-backups-us-central1', specifying '--location=us-central1' for the location and '--default-storage-class=NEARLINE' to set the default storage class for created objects.

Step-by-Step Solution

1
Identify the required CLI tool suite
Selected the modern 'gcloud storage buckets create' command structure over legacy gsutil commands
Google Cloud recommends using the gcloud storage component for bucket and object operations
2
Specify the required bucket location
Passed '--location=us-central1'
The --location flag sets the geographic region for the newly deployed Cloud Storage bucket
3
Configure default object storage class
Passed '--default-storage-class=NEARLINE'
The --default-storage-class flag ensures all newly uploaded objects inherit Nearline storage properties unless explicitly overridden

Key Concept

Deploying Cloud Storage buckets using the gcloud CLI with location and storage class configurations.
Rate this question