Python CLI for convenient emptying of S3 bucket
Project description
S3Empty
S3Empty is a Python CLI for conveniently emptying an AWS S3 bucket.
This tool is useful when you want to delete all objects in a bucket before deleting the bucket itself. It handles versioned and non-versioned S3 buckets.
BucketNotEmpty: The bucket you tried to delete is not empty. You must delete all versions in the bucket.
Installation
pip3 install s3empty
Usage
Run S3Empty with specified bucket name:
s3empty --bucket-name some-bucket
Show help guide:
s3empty --help
Permission
Here's an IAM policy with minimum permissions required by S3Empty:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S3EmptyPolicy",
"Effect": "Allow",
"Action": [
"s3:GetBucketVersioning",
"s3:ListBucket",
"s3:ListBucketVersions",
"s3:DeleteObject",
"s3:DeleteObjectVersion",
],
"Resource": [
"arn:aws:s3:::some-bucket",
"arn:aws:s3:::some-bucket/*"
]
}
]
}
Colophon
Build reports:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
s3empty-1.0.1.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file s3empty-1.0.1.tar.gz
.
File metadata
- Download URL: s3empty-1.0.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76a2066e2245ec8ab2488cba24fa60dd0764ec99bad2c873f6c2371961ba38e4 |
|
MD5 | cfde37f46b1d9e33db319a7663c4beae |
|
BLAKE2b-256 | 5a93302bea03d4e652945533b5b905b9d92b31fdd50d8c9d1d2a6b7db3d7cdec |
File details
Details for the file s3empty-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: s3empty-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 671b7f9c6f35fe0f06290768c3b0ab392594cf6a616d88829dc09f3026d8bc83 |
|
MD5 | f5fc05778471ea5456897d639447ad00 |
|
BLAKE2b-256 | 66a482abb2a3aee429ea2c854acd6e896504c0d7ecb197c79679e46e0fb377b3 |