Deepak
Deepak

Reputation: 13

Multiple Expire lifecycle policy configs in S3

Lets say I have folder-a/ , folder-b/ and folder-logs/ in S3 bucket.

I want to preserve folder-logs/ objects for 90 days, objects older than 90 days can be deleted. All other objects except folder-logs/ can be deleted in 30 days.

I have created a lifecycle config as

  1. Expire objects older than 90 days. Prefix - folder-logs/
  2. Expire all items in 30 days.

So, what happens to my folder-logs/ objects. Does 2nd rule takes precedence here? i.e., the folder-logs/ objects gets deleted after 30 days or it is preserved for 90 days? And does order of the lifecycle config matters here?.

I have created two lifecycle configs as mentioned above. Just wanted to know the result. This bucket is not enabled with versioning.

Upvotes: 1

Views: 465

Answers (1)

Marcin
Marcin

Reputation: 238259

Your objects will expire in 30 days, as explained in AWS docs:

if two expiration policies overlap, the shorter expiration policy is honored so that data is not stored for longer than expected.

Upvotes: 1

Related Questions