Search code examples
amazon-web-servicesamazon-s3amazon-glacier

Any limitation on number of s3 lifecycle rules?


I want to move some millions of s3 objects to glacier.

path/to/object1/1.jpg
path/to/object2/2.jpg
...

So I will set s3 lifecyle rules like this.

Rule 1
prefix: path/to/object1/1.jpg

Rule 2
prefix: path/to/object2/2.jpg

...

Rule n
prefix: ...

Is there any limitation on number of lifecyle rules?

Target objects have no common pattern on path.


Solution

  • This is admittedly a little bit elusive in the documentation, but it is mentioned here:

    An S3 Lifecycle configuration can have up to 1,000 rules. This limit is not adjustable. The <ID> element uniquely identifies a rule. ID length is limited to 255 characters.

    Source: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html

    Each bucket can have only 1 lifecycle configuration (or none), so that's your limit.