Soru

Zorluk: Çok zorDeploying and Configuring Cloud Storage Buckets and Objects

A DevOps engineering team is upgrading an automated infrastructure deployment pipeline to adhere to current Google Cloud CLI best practices. They need to deploy a new Cloud Storage bucket named `gs://compliance-audit-logs-2026` in the `us-central1` region. Security and governance policies mandate that the bucket must enforce Uniform Bucket-Level Access (UBLA), set a default storage class of `COLDLINE` for all newly ingested objects, and enforce an unalterable object retention duration of 365 days. The team mandates using the modern `gcloud storage` CLI component rather than legacy `gsutil` commands. Which `gcloud storage` command correctly provisions this bucket with all specified configurations in a single step?

  1. gcloud storage buckets create gs://compliance-audit-logs-2026 --location=us-central1 --default-storage-class=COLDLINE --uniform-bucket-level-access --retention-period=365dCevap
  2. B
    gcloud storage buckets create gs://compliance-audit-logs-2026 --location=us-central1 --storage-class=COLDLINE --enable-uniform-bucket-level-access --retention=365d
  3. C
    gcloud storage buckets create gs://compliance-audit-logs-2026 --location=us-central1 --default-storage-class=COLDLINE --predefined-acl=private --retention-period=365d
  4. D
    gcloud storage buckets create gs://compliance-audit-logs-2026 --location=us-central1 --default-storage-class=ARCHIVE --uniform-bucket-level-access --retention-period=365d

Cevap

The command `gcloud storage buckets create gs://compliance-audit-logs-2026 --location=us-central1 --default-storage-class=COLDLINE --uniform-bucket-level-access --retention-period=365d` correctly creates the bucket with all required settings using modern `gcloud storage` syntax.
The correct command utilizes valid `gcloud storage buckets create` syntax with exact flags: `--location=us-central1` sets the deployment region, `--default-storage-class=COLDLINE` configures the default storage class for new objects, `--uniform-bucket-level-access` disables legacy per-object ACLs in favor of IAM, and `--retention-period=365d` enforces a 365-day object retention policy.

Adım Adım Çözüm

1
Identify the modern Google Cloud CLI command group for bucket deployment
Recognize that `gcloud storage buckets create` is the recommended syntax for bucket provisioning.
`gcloud storage` replaces legacy `gsutil` syntax and uses standard double-dash flag structures.
2
Validate the flags for location and default storage class
Use `--location=us-central1` and `--default-storage-class=COLDLINE`.
In `gcloud storage buckets create`, default object storage class is controlled via `--default-storage-class` rather than `--storage-class` or `-c`.
3
Verify flags for access control and object retention
Specify `--uniform-bucket-level-access` to disable ACLs and `--retention-period=365d` to enforce object retention.
Uniform Bucket-Level Access is enabled using the boolean flag `--uniform-bucket-level-access`, and retention duration is set via `--retention-period`.

Anahtar Kavram

Deploying Cloud Storage Buckets using gcloud storage CLI
Bu soruyu puanla