Your organization needs to configure an automated lifecycle policy for a Google Cloud Storage bucket used to store audit logs. The policy must automatically transition objects from Standard to Nearline storage after 30 days and permanently delete them after 365 days. You want to accomplish this using the modern Google Cloud CLI. Which approach should you take to deploy this configuration?
- Create a JSON configuration file defining the lifecycle rules with Age conditions and corresponding SetStorageClass and Delete actions, then run gcloud storage buckets update gs://[BUCKET_NAME] --lifecycle-file=[FILE_PATH].Cevap
- BCreate a lifecycle configuration file and execute gsutil lifecycle set [FILE_PATH] gs://[BUCKET_NAME] to deploy the rules.
- CDefine the transition and deletion schedules inside an IAM policy JSON document and apply it using gcloud storage buckets set-iam-policy gs://[BUCKET_NAME] policy.json.
- DDeploy the bucket with Nearline as its default storage class upon creation and configure object-level retention policies on individual uploads to handle automatic deletion.
Cevap
Create a JSON configuration file defining the lifecycle rules with Age conditions and corresponding SetStorageClass and Delete actions, then run gcloud storage buckets update gs://[BUCKET_NAME] --lifecycle-file=[FILE_PATH].
The correct approach is to create a JSON file defining condition rules (age in days) and actions (SetStorageClass to NEARLINE at 30 days, Delete at 365 days), and update the bucket configuration using gcloud storage buckets update gs://[BUCKET_NAME] --lifecycle-file=[FILE_PATH]. This follows Google-recommended practices using modern gcloud CLI tools.
Adım Adım Çözüm
Anahtar Kavram
Cloud Storage Object Lifecycle Management configuration using gcloud storage