Skip to content

How to delete 10Millions objects in s3 without incurring charge

0

Hi i have 10Million objects in s3, i want to delete entire bucket but for that to do so, i need to empty the bucket, how do i delete entire bucket without incurring any charges

thank you

asked 2 years ago784 views
2 Answers
1

As your bucket contains large number of objects 10M, creating a lifecycle rule to delete all objects in the bucket is definitely more efficient way of emptying your bucket. It is not instantaneous, will take a day or two depends what time of the day you create the LC rule. https://docs.aws.amazon.com/AmazonS3/latest/userguide/empty-bucket.html?icmpid=docs_amazons3_console#empty-bucket-lifecycle

Once the bucket is empty, you can delete the bucket by any mechanism.

Also pls note once deleted this bucket name would be available to use only in your account for 24 hrs, post that its globally available. For any reason if you want to keep hold of the bucket, you may update the bucket policy to deny any PUT. This way no new object will be created in this bucket and you will be able to keep the empty bucket for how long you want.

AWS
answered 2 years ago
0

Deletes are free according to the documentation. I would empty the bucket using the GUI.

You can empty a bucket's contents using the Amazon S3 console, AWS SDKs, or AWS Command Line Interface (AWS CLI). When you empty a bucket, you delete all the objects, but you keep the bucket. After you empty a bucket, it cannot be undone. Objects added to the bucket while the empty bucket action is in progress might be deleted. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted.

Charges are accrued at the same rate as requests that are made using the API/SDK. Reference the S3 developer guide for technical details on the following request types: PUT, COPY, POST, LIST, GET, SELECT, Lifecycle Transition, and Data Retrievals. DELETE and CANCEL requests are free. LIST requests for any storage class are charged at the same rate as S3 Standard PUT, COPY, and POST requests.

https://aws.amazon.com/s3/pricing/

EXPERT
answered 2 years ago
  • so if i delete using dashboard GUI i wont be charged?

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.