S3 Lifecycle rule precedence - multiple rules or just one?

0

Hi community

If I have an S3 bucket with 2 lifecycle rules, which:

  • one rule looks for a tag to expire objects after 90 days
  • another rules looks for a different tag to transition an object to glacier after 7 days

How does that take precedence? If i'm at day 10 after the object creation (it was created with all the corresponding tags) shouldn't it be transitioned to glacier? And when day 90 arrives should it be deleted?

Not sure if the rule setup is ok, maybe I should consolidate in one rule with 2 actions?

Thanks! Eric

demandé il y a 2 mois163 vues
1 réponse
3
Réponse acceptée

Hello Eric,

If an object meets the criteria of both rules, the action specified in the first rule (transition to Glacier after 7 days) will take precedence, and the object will be transitioned to Glacier after 7 days. The expiration action specified in the second rule (after 90 days) will not be applied to this object because it has already been transitioned to Glacier.

To achieve the desired behavior, you can consolidate both actions into a single lifecycle rule with multiple actions. You can define a single rule with two actions: one to transition the object to Glacier after 7 days and another to expire the object after 90 days. This consolidation ensures that both actions are applied sequentially in the desired order.

With this consolidated rule, objects with the specified tag will be transitioned to Glacier after 7 days and then expired after 90 days if they have not already been deleted or transitioned

Hope it clarifies and if does I would appreciate answer to be accepted so that community can benefit for clarity, thanks ;)

profile picture
EXPERT
répondu il y a 2 mois
profile picture
EXPERT
vérifié il y a 2 mois
  • Hi Adeleke, sounds great, I'll give it a try. Thank you very much for your help!

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions