An administrator needs to deploy a Cloud Storage bucket for log archiving and configure a lifecycle management policy using the Google Cloud CLI (`gcloud storage`). Place the following steps in the correct execution order from first to last.
- 1Draft a local JSON file specifying the lifecycle conditions and actions (such as transitioning objects to Nearline storage after 30 days).
- 2Execute `gcloud storage buckets create gs://my-log-archive-bucket --location=us-central1` to provision the destination bucket.
- 3Execute `gcloud storage buckets update gs://my-log-archive-bucket --lifecycle-file=lifecycle.json` to attach the policy.
- 4Upload the log files into the bucket using `gcloud storage cp log.txt gs://my-log-archive-bucket/`.
Answer
The correct operational sequence is: 1) Create the local lifecycle JSON file, 2) Provision the Cloud Storage bucket with `gcloud storage buckets create`, 3) Apply the lifecycle configuration to the bucket using `gcloud storage buckets update`, and 4) Upload objects to the configured bucket using `gcloud storage cp`.
Deploying a configured storage bucket requires creating the prerequisite configuration files, provisioning the bucket resource via CLI, binding the lifecycle rules file to the bucket resource, and finally populating the bucket with objects.
Step-by-Step Solution
Key Concept
Cloud Storage Bucket Provisioning and Lifecycle Rule Configuration