ベン・ギルド (Ben Guild)


How to delete all files in an Amazon S3 bucket easily. 🗑

Once you've uploaded a large quantity of files to Amazon S3 (Simple Storage Service), it can be troublesome to remove them afterward if you then want to delete the non-empty bucket. — Luckily, finally, there is a way to wipe out entire buckets of stuff without using scripts or third-party software!

To do this: Edit the bucket's properties, and select the “Lifecycle” tab. — Create a blank rule with a “1 day(s)” expiration date. A warning will appear when you save, stating that this “blank” rule will apply to all files in the bucket… which is what you want. 😅

Screnshot of adjusting the “Lifecycle” of items on Amazon S3 to purge them quickly and easily.
Adjusting the “Lifecycle” of items on Amazon S3 to purge them quickly and easily.

Within the time you specify (in this case… “1 day(s)”), all remaining items in the bucket will be purged automatically, and the bucket can then be deleted! — Phew. 😎