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

asked 9 months ago1113 views
1 Answer
1
Accepted Answer

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
EXPERT
answered 9 months ago
profile picture
EXPERT
reviewed 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions