英文:
Multiple Expire lifecycle policy configs in S3
问题
我有 folder-a/、folder-b/ 和 folder-logs/ 在 S3 存储桶中。
我想要保留 folder-logs/ 文件夹中的对象 90 天,90 天以上的对象可以删除。
除了 folder-logs/ 文件夹以外的所有对象可以在 30 天内删除。
我已经创建了一个生命周期配置:
- 删除 90 天以上的对象。前缀 - folder-logs/
- 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
- Expire objects older than 90 days. Prefix - folder-logs/
- 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论