
Answer-first summary for fast verification
Answer: Implement a lifecycle policy to delete objects older than a month.
The correct answer is **B** because the files older than a month are no longer needed and can be deleted, eliminating the necessity for storage. Object Lifecycle Management simplifies the transition process. Refer to the GCP documentation on [Cloud Storage Lifecycle Management](https://cloud.google.com/storage/docs/lifecycle) for more details. Lifecycle management configurations can be applied to a bucket, containing rules that automatically perform specified actions on objects meeting certain criteria. Examples include downgrading the storage class of objects older than 365 days to Coldline Storage, deleting objects created before a specific date, or retaining only the most recent versions of each object in a versioned bucket. - **Option A** is incorrect because transitioning to Coldline storage is unnecessary if the files are not needed. - **Options C & D** are incorrect because Object Lifecycle Management offers a simpler solution than custom Cloud Functions for this scenario.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your data team is developing new machine learning models and generates several output files daily, which they wish to store in a regional bucket. They are primarily interested in the output files from the last month and want to automatically clean up files older than a month. What is the most efficient method to implement this solution?
A
Create a Cloud Function triggered upon object addition to a bucket, which checks the file dates and moves them to Coldline storage if older than a month.
B
Implement a lifecycle policy to delete objects older than a month.
C
Set up a lifecycle policy to transition objects older than a month to Coldline storage.
D
Develop a Cloud Function that activates when objects are added to a bucket, examines the date on all files, and deletes those older than a month.
No comments yet.