I added a lifecycle rule to my S3 bucket. The purpose is to delete any object older than 30 days. Therefore, I configured the following settings on the S3 Bucket:
- Versioning property is enabled
- A new lifecycle rule was added
Here are the lifecycle rule configurations:
- Rule scope: Apply to all objects in the bucket
- Transitions were not configured (since those S3 objects should be deleted and not archived somewhere else)
- Expiration configurations:
both current version and previous versions checked
Expire current version of object: After 30 days from object creation
Permanently delete previous versions: After 1 days from becoming a previous version
Clean up expired object delete markers and incomplete multipart uploads is greyed out since I checked "Expire current version of object"
Clean up incomplete multipart uploads: After 7 days from start of upload
Visual display in here
After the creation of that rule I saw that the rule is enabled, and the expiration date is displayed properly on the desired S3 objects:
The last modified timestamp is a month before the expiration date
Visual display in here
I'll mention that unlike other questions that were raised in here, the objects that I want to delete (on a regular basis) are small (less then a KB) and there are not many of them (not more then 100 totally).
thank you.