AWS Builder Center
Deleted from S3, Still on the Bill?

Deleted from S3, Still on the Bill?

Deleted some files from S3 but still paying for storage? Versioning might explain why.

An S3 bucket can look empty and still contain data you're paying for.
If you have S3 Versioning enabled, deleting an object doesn't necessarily remove it. A normal delete adds a delete marker, which hides the object from the usual view. The older versions are still there, taking up storage.
You can check this in the S3 console:
  1. Open your bucket and go to Objects.
  2. Turn on Show versions.
  3. Look for older versions and delete markers.
Versioning is useful, especially when someone accidentally deletes or overwrites an important file. But keeping every old version forever can get expensive.
One option is to add an S3 Lifecycle rule that removes noncurrent versions after a certain number of days.
Just make sure the retention period gives you enough time to recover files if something goes wrong. It's a small setting worth checking, especially in buckets used for testing.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article