Delete S3 Bucket with Multi-Object Delete

Lately, My company have a project which never officially announced, and we decided to shut it down, so I shutdown the all servers, and pull down the iOS on the App Store this week.

Since we use S3 to store all our files, I try to delete the bucket with “Transmit", the Mac App, but it tooks days, or maybe week, I have no idea, but it looks like the deletion never ends.

So, I wrote a python script to delete S3 bucket which contains lots of files, according to this article, Amazon S3 – Multi-Object Delete.

You can delete 1000 objects once at a time, and reduce the requests cost with S3, that makes you delete unwanted bucket as quick as possible.

At last, I delete 3 buckets with in 10 minutes, instead of days or even week.

Here is the script I put on the gist

tzangms

Read more posts by this author.

Subscribe to Oceanic / 海海人生

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!