A cloud administrator needs to automate object lifecycle management on an existing Google Cloud Storage bucket to transition objects older than 30 days to Nearline storage. Arrange the operational steps in the correct sequence to define, apply, and verify the lifecycle policy using the modern `gcloud storage` CLI tool.
- 1Construct a local JSON policy file (e.g., `lifecycle.json`) defining the `SetStorageClass` action to `NEARLINE` for objects matching the `age` condition of 30 days.
- 2Execute `gcloud storage buckets update gs://[BUCKET_NAME] --lifecycle-file=lifecycle.json` to bind the policy rules to the bucket.
- 3Run `gcloud storage buckets describe gs://[BUCKET_NAME] --format="json(lifecycle)"` to inspect and confirm the active configuration.
- 4Upload a sample object using `gcloud storage cp test-file.txt gs://[BUCKET_NAME]/` to test bucket operations under the updated policy.
Answer
The correct operational sequence is: First, create the local JSON lifecycle policy file specifying the action and age conditions. Second, deploy the policy file to the target bucket using `gcloud storage buckets update --lifecycle-file`. Third, verify the applied policy using `gcloud storage buckets describe`. Fourth, test write operations on the bucket by uploading a test file with `gcloud storage cp`.
The operational workflow for deploying Cloud Storage bucket lifecycle rules follows standard cloud infrastructure configuration steps: policy definition in a local manifest, execution of the updating CLI command to sync changes to GCP, metadata verification to ensure the deployment succeeded, and functional validation through an object upload test.
Step-by-Step Solution
Key Concept
Configuring Cloud Storage Object Lifecycle Policies using gcloud storage CLI