在S3中的多个到期生命周期策略配置

huangapple go评论63阅读模式
英文:

Multiple Expire lifecycle policy configs in S3

问题

我有 folder-a/、folder-b/ 和 folder-logs/ 在 S3 存储桶中。

我想要保留 folder-logs/ 文件夹中的对象 90 天,90 天以上的对象可以删除。
除了 folder-logs/ 文件夹以外的所有对象可以在 30 天内删除。

我已经创建了一个生命周期配置:

  1. 删除 90 天以上的对象。前缀 - folder-logs/
  2. 30 天内删除所有项目。

那么,我的 folder-logs/ 对象会发生什么呢?第二条规则是否占据主导地位?也就是说,folder-logs/ 对象会在 30 天后被删除,还是会保留 90 天?而且,生命周期配置的顺序是否在这里起作用?

我已经按上述方式创建了两个生命周期配置。只是想知道结果。这个存储桶没有启用版本控制。

英文:

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.

答案1

得分: 1

你的对象将在30天后过期,如AWS文档中所解释的:

> 如果两个过期策略重叠,将遵守较短的过期策略,以确保数据不会存储超过预期的时间。

英文:

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.

huangapple
  • 本文由 发表于 2023年6月15日 08:42:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76478395.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定