Amazon S3 Aws - How to delete a bucket using boto API
This example shows how to remove a bucket invoking python API provided by boto.
Important note: the bucket must be empty.
post this code
access_key = '<aws access key>'
secret_key = '<aws secret key>'
# This code initialize the Amazon S3 connection to your account
conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key)
# Iteration through all available buckets stored into S3
# Name and creation date are listed
for bucket in conn.get_all_buckets():
name = bucket.name,
created = bucket.creation_date,
# Remove the bucket
If you want to be updated about similar snippets,
and follow our Channels