Delete Versioned Amazon S3 Bucket

If you’ve enabled versioning in an Amazon S3 Bucket it’s not that easy to delete it. Open the web console and execute the following steps:

  1. Delete All Objects

  2. Suspend Versioning

  3. Show Versions

  4. Delete Versions

  5. Delete Bucket

All these steps are also possible on the console (aws-cli), but I didn’t find out how yet.

  1. aws s3 rm --recursive s3://mybucket

  2. aws s3api put-bucket-versioning --bucket mybucket --versioning-configuration Status=Suspended

  3. (Delete All Versions)

  4. aws s3 rb --force s3://mybucket