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

feita há 2 meses163 visualizações
1 Resposta
3
Resposta aceita

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
ESPECIALISTA
respondido há 2 meses
profile picture
ESPECIALISTA
avaliado há 2 meses
  • Hi Adeleke, sounds great, I'll give it a try. Thank you very much for your help!

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas