Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When will AWS S3 delete the expired objects?

I have a AWS S3 bucket with a 1 day expiration lifecycle rule. But the AWS didn’t delete the expired objects automatically. How can I let AWS delete the expired objects automatically? Are there still additional cost for these expired but unremoved objects?

like image 254
YangChen Avatar asked Dec 16 '17 08:12

YangChen


2 Answers

Please be aware that AWS only guarantees you will not be billed for expired objects. AWS gives no guarantees when expired objects will actually be cleaned. In my experience, this is usually a day within expiring, but this week I ran into a production issue, because one of my Lambda's choked on the amount of objects in my S3 bucket, which is normally limited, due to a Lifecycle Policy I set on the bucket. An inquiry at Amazon AWS Support confirmed this:

Thank you for the provided information, I have checked the LifeCycle Management for the eu-west-1 region and have noted that there has been a recent increase in the number of objects to be expired. As the LifeCycle Manager is asynchronous for all S3 Buckets the region, increases in the number of objects to be expired can introduce longer delays [1].

So please be aware of this, when you're crafting your AWSome solutions!

[1] https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-expire-general-considerations.html

like image 151
Martin Devillers Avatar answered Oct 13 '22 01:10

Martin Devillers


No AWS will evaluate the expiration rules once in a day and will not be charged for that as said in below doc.

We evaluate the expiration rules once each day. During this time, based on their expiration dates, any object found to be expired will be queued for removal. You will not be billed for any associated storage for those objects on or after their expiration date. If server access logging has been enabled for that S3 bucket, an S3.EXPIRE.OBJECT record will be generated when an object is removed.

https://aws.amazon.com/blogs/aws/amazon-s3-object-expiration/

like image 19
sanath meti Avatar answered Oct 13 '22 03:10

sanath meti