Open mdavis-xyz opened 2 years ago
@mdavis-xyz Thank you for this feature idea. Would you be willing to work on it and open a pull request?
I just found out that Lifecycles actually already have a minimum size filter for these transitions.
Objects smaller than 128 KB – For the following transitions, Amazon S3 does not transition objects that are smaller than 128 KB:
From the S3 Standard or S3 Standard-IA storage classes to S3 Intelligent-Tiering or S3 Glacier Instant Retrieval.
From the S3 Standard storage class to S3 Standard-IA or S3 One Zone-IA.
Therefore I don't need this new Ansible functionality for my use case. So I probably won't write this until much later this year when I get some spare time (and after writing other PRs I more urgently need.)
Summary
STANDARD_IA and GLACIER classes in S3 include an overhead for access history data. For small files the overhead can be larger than the file itself, so you end up paying more to store small files in these supposedly cheaper classes.
The solution is to add a minimum size filter to the lifecycle config. The API supports this. The s3_lifecycle ansible module does not yet support these. We should add a min size filter (and also max size filter).
Issue Type
Feature Idea
Component Name
s3_lifecycle
Additional Information
In the boto3 call,
ObjectSizeGreaterThan
andObjectSizeLessThan
are optional fields which go next to Prefix under Filter. They are the number of bytes (not kB).I propose this usage:
Code of Conduct