My sample bucket have not versioning enabled. All objects are about 2 years old.
Filter to delete with prefix ie. 153 or 15181 not work.
Finally I tried no prefix (applied to all) then it works.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html
...
<Filter>
<And>
<Prefix>tax/</Prefix>
<Tag>
<Key>key1</Key>
<Value>value1</Value>
</Tag>
<Tag>
<Key>key2</Key>
<Value>value2</Value>
</Tag>
</And>
</Filter>
...
https://aws.amazon.com/premiumsupport/knowledge-center/s3-prefix-nested-folders-difference/
May be my prefix setup above is wrong, I have to specify full "path" to file/object prefix.
Instead of '153' => my-website-dir/153 (Do not include bucket name)
https://stackoverflow.com/questions/29971176/how-to-search-an-amazon-s3-bucket-using-wildcards
https://github.com/aws/aws-cli/issues/3784
The PUT livecycle API takes a "Prefix", which as the name says is a prefix, not a regex. http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html
There is also a limit of 1000 rules per bucket. http://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html
You could change your folder structure so that keys look like "new/folderN".
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html
Comments
Post a Comment