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!

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则