Can I use multiple lifecycle policies on a S3 bucket?

0

Greetings,

I setup a S3 bucket to archive my Elasticsearch index. I am getting logs from an environment that needs a retention of 90 days. However, ONE server in this environment requires 365 days. Is it possible to setup two lifecycle policies in the same bucket?

For example,

type : env (Use lifecycle policy A with 90 days of retention) type : env_exception (Use Lifecycle policy B with 365 days of retention)

I tried to do it, but something feels wrong. The lifecycle policies keep disappearing and they never seem to be showing at the same time.

Thank you,

Mathieu

質問済み 10ヶ月前1212ビュー
1回答
1
承認された回答

Hello.
It is possible to have more than one lifecycle policy.
However, if duplicate rules are set, the shorter rule takes precedence.
We also observed that in the case of complete duplicates, the behavior was such that the rules were being overwritten.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lifecycle-config-conceptual-ex5

You might specify an S3 Lifecycle configuration in which you specify overlapping prefixes, or actions.

Generally, S3 Lifecycle optimizes for cost. For example, if two expiration policies overlap, the shorter expiration policy is honored so that data is not stored for longer than expected. Likewise, if two transition policies overlap, S3 Lifecycle transitions your objects to the lower-cost storage class.

profile picture
エキスパート
回答済み 10ヶ月前
profile picture
エキスパート
レビュー済み 10ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ