Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Overriding lifecycle rule of GCS bucket

Hi, 

Is it possible to have a rule that deletes objects after certain age. Then add additional rule that cancel this rule for specific prefix?

Also is there any order/weight of the lifecycle rules. For exmplae if I create a rule that has certain age, and then another rule that overrides that age

0 5 800
5 REPLIES 5

@shamil1 

Can you help with action for each rule is it delete or change storage class?

Hi @VishalBulbule 
The action is delete

Here is order of execution

VishalBulbule_0-1674480844345.png

if you have two delete rule , if first rule matching all condition age,prefix then it will delete object.

Thanks @VishalBulbule 

I'm trying to have a rule that covers entire bucket, but exclude specific prefix(s). So for exaample I want the bucker delete all object after certain of time, but ignore specific prefixes. Is it possible?

@shamil1 

There are option which can help to include only certain object using prefix and suffix  like below , but for your condition if you want to avoid deletion for certain object then option is to add retention policy or object hold for that object. 

For including specific object

VishalBulbule_0-1674481529422.png

 

for excluding specific object

VishalBulbule_1-1674481619665.png

Let me know if additional help needed.