Would like help in determining the cost for deleting all objects in a bucket


We have a bucket of data / objects that are no longer needed / viable. Before we delete we'd like to know how much it will cost us to do so. The bucket can remain and may get re-used in the future, but all the data inside of it needs to be wiped out.

The formulas seem a bit convoluted as the data / objects are spread in Standard S3 and in Glacier S3. Is there an easy formula to plug in our values?

There are approximately 21M objects in the bucket. I don't see a way to correlate objects to storage type (Standard / Glacier).

1 Answer

There is no cost to delete objects in S3, but the method you use to delete 21M objects may incur cost. Assuming we want to delete all objects within this specific bucket, and that versioning is not enabled on this bucket, the simplest method would likely be to use an S3 Lifecycle Rule to purge all of the objects.

When using S3 Lifecycle Rules, we are not charged for API operations in S3 (such as a LIST operation), but we are charged for the lifecycle transition. When using S3 Standard, lifecycle transitions are actually free, but there is a charge associated with lifecycle transitions when using an S3 Glacier storage class see here.

The exact charge to use S3 Lifecycle Rules for this delete operation will depend on how many objects we're storing in S3 Standard vs. S3 Glacier, and you may also want to consider that S3 Glacier has a minimum storage duration that we will be billed for, assuming there are newly stored objects within this storage class.

profile pictureAWS
answered a year ago
  • Thank you Darren. We'll look at S3 Inventory and S3 Batch to determine how many objects in each storage class to better determine costs for deleting. We believe that the objects are "old enough" to not incur "early withdrawal" penalties, but will check on that as well. Appreciate the thoughts / ideas!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions