多个文件夹上的AWS S3生命周期规则 [英] AWS S3 lifecycle rule on multiple folders
问题描述
我有一个包含许多文件夹的存储桶,我想仅对存储桶中的某些文件夹应用生命周期规则. 是否可以在存储桶中的多个文件夹(PREfixes)上应用AWS S3生命周期规则?
I have a bucket that contains many folders and I would like to apply a lifecycle rule only fore some folders within the bucket. It's possible to apply an AWS S3 lifecycle rule on multiple folders(PREfixes) within a bucket?
例如,我有一个存储桶s3://mybucket,其中包含文件夹1,文件夹2,文件夹3,文件夹4.我只想发送Glacier文件夹1和文件夹4.
For example I have a bucket s3://mybucket that contains folder1, folder2 folder3, folder4. I would like to send to Glacier only folder1 and folder 4.
我的问题是:我需要为每个文件夹(前缀)创建一个新规则,还是可以将所有它们都插入一个规则中?
My question is: I need to create new rule for every folder(prefix) or it is a possibility to insert all of them in a single rule?
推荐答案
从 S3管理生命周期配置:
您可以为存储桶中的所有对象或对象子集定义规则(通过指定键名称前缀).
You can define a rule for all objects or a subset of objects in the bucket (by specifying the key name prefix).
换句话说,规则适用于共享相同前缀的所有对象.如果您有许多不同的前缀(例如folder1
,folder2
等),则必须复制规则并相应地更改前缀.另外,您可以添加新的公共前缀(例如send-to-glacier/folder1
,send-to-glacier/folder2
,然后为send-to-glacier
前缀创建新规则).
In other words, a rule applies to all objects that share the same prefix. If you have many different prefixes (such as folder1
, folder2
, etc) you must copy the rule and change the prefix accordingly. Alternatively, you can add a new common prefix (e.g. send-to-glacier/folder1
, send-to-glacier/folder2
and then create a new rule for the send-to-glacier
prefix).
这篇关于多个文件夹上的AWS S3生命周期规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!