This CLI application is designed to interact with AWS S3 service for the purpose of deleting an existing S3 bucket. It provides an interactive way to delete a bucket and its contents securely, with optional prompt for confirmation to help prevent accidental deletion of important data.
When executed, this CLI performs the following operations:
- Detect whether the bucket has Object Versioning enabled and disable it if it does.
- Lists all the objects in the given bucket.
- Deletes all the objects retrieved from the bucket.
- After ensuring that all objects have been deleted, it then proceeds to delete the bucket.
To run the CLI:
delete-bucket [OPTIONS]
Options:
-h, --help
Prints help information-f, --force
Do not prompt for approval.-p, --profile
The AWS profile to use-r, --region
The AWS region to use-b, --buckets
Buckets to delete.
Deleting 10K files in a single bucket on c6i.2xlarge
machine:
delete-bucket
- 6.234saws s3 rm s3://bucket-name --recursive
AWS Docs - 25.086s
That's fast! 💨
There are two main methods for installing this tool:
You can download the pre-compiled binaries directly from the GitHub releases page. Choose the correct binary depending on your operating system.
Visit the releases page to download the appropriate binary. For example (make sure to use the latest version):
wget https://github.com/aws-cli-tools/delete-bucket/releases/download/v0.1.5/delete-bucket-v0.1.5-x86_64-linux.tar.xz
tar -xf delete-bucket-v0.1.5-x86_64-linux.tar.xz
If you are a macOS user and have Homebrew installed, you can install this tool using the following commands:
brew tap aws-cli-tools/aws-cli-tools
brew install delete-bucket
- You can always use
cargo
to manage the build and tests. - We use
just
as a command running. - Use
just gate
to run all checks locally.
See our CONTRIBUTION page