- Newest
- Most votes
- Most comments
Hello,
Thanks for reaching out to us at AWS re:Post. Sameer this side from S3 Support Team and here to assist further on the question you asked here.
As from the post, I understand that you would like to setup a S3 bucket lifecycle rule to move all the objects to Glacier storage class 90 days and want to exclude a specific subfolder from this action (do not wish to move data in this subfolder to Glacier storage class). Please correct me if I have misunderstood your query.
I would like to share that the use-case to exclude a subfolder/s is not currently supported with S3 Lifecycle rules. You can currently use the below filters [1] : - Apply rule to the whole S3 bucket - Apply rule to a specific prefix (one prefix can be specified per lifecycle rule) - Apply rule based on the Object size - Apply rule based on the Object tags.
As there is no direct solution to your use-case, you can use any of the below workarounds to setup lifecycle rule on the S3 bucket. For this, let us consider you have 10 folders at the root of your S3 bucket and would like to exclude 1 folder in them :
-
Apply prefix-based lifecycle rule on all the 9 subfolders except the one specific subfolder which you would like to exclude.
-
If the objects present in 9 subfolders have any specific pattern — contain any specific tags — use a tag-based lifecycle rule.
-
If the objects present in 1 subfolder which you would like to exclude have a pattern of their size — either are all large files/small files as compared to the objects in other 9 subfolders — use a size-based filter in the lifecycle rule.
-
Move all the 9 subfolders inside another folders at the root of the bucket and apply a prefix-based lifecycle rule on that new folder created. OR, move the 1 subfolder to a different S3 bucket or to a different root-level folder in the same bucket.
I hope I was able to address your query on the post. In case of any follow-up queries/clarification, please proceed to open a case with AWS Support Engineering at [3]. Thanks for your patience & cooperation!
[1] https://docs.aws.amazon.com/AmazonS3/latest/userguide/how-to-set-lifecycle-configuration-intro.html [2] https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-filters.html [3] https://console.aws.amazon.com/support/home#/case/create?issueType=technical
Relevant content
asked 4 years ago
asked 3 years ago
asked 2 months ago
