ASSOCIATE-CLOUD-ENGINEER · Question #338
The storage costs for your application logs have far exceeded the project budget. The logs are currently being retained indefinitely in the Cloud Storage bucket myapp-gcp-ace-logs. You have been asked
The correct answer is B. Write a lifecycle management rule in JSON and push it to the bucket with gsutil lifecycle set. To automatically remove logs older than 90 days from a Cloud Storage bucket and optimize costs, implement a lifecycle management rule defined in JSON and apply it to the bucket.
Question
Options
- AWrite a script that runs gsutil Is -| ?gs://myapp-gcp-ace-logs/** to find and remove items older
- BWrite a lifecycle management rule in JSON and push it to the bucket with gsutil lifecycle set
- CWrite a lifecycle management rule in XML and push it to the bucket with gsutil lifecycle set config-
- DWrite a script that runs gsutil Is -Ir gs://myapp-gcp-ace-logs/** to find and remove items older than
How the community answered
(40 responses)- A3% (1)
- B90% (36)
- C5% (2)
- D3% (1)
Why each option
To automatically remove logs older than 90 days from a Cloud Storage bucket and optimize costs, implement a lifecycle management rule defined in JSON and apply it to the bucket.
Writing and maintaining a custom script for deletion is less efficient, more prone to errors, and incurs compute costs compared to Cloud Storage's built-in lifecycle management.
Cloud Storage Lifecycle Management rules automate object management based on predefined conditions, such as age, to delete old logs and optimize storage costs. These rules are configured using a JSON file, which is then applied to the bucket using the `gsutil lifecycle set` command, providing an efficient and automated solution.
Cloud Storage lifecycle management rules are defined in JSON format, not XML, making this option incorrect.
Similar to option A, a custom script is not the recommended or most cost-effective method for automating object deletion compared to Cloud Storage lifecycle management.
Concept tested: Cloud Storage Lifecycle Management for cost optimization
Source: https://cloud.google.com/storage/docs/managing-lifecycles
Topics
Community Discussion
No community discussion yet for this question.