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

질문됨 2달 전163회 조회
1개 답변
3
수락된 답변

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
전문가
답변함 2달 전
profile picture
전문가
검토됨 2달 전
  • Hi Adeleke, sounds great, I'll give it a try. Thank you very much for your help!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인