Created
May 8, 2019 16:12
-
-
Save jbcurtin/dcaacc69d1942c6c003d6b9fe990b8f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import boto3 | |
s3client = boto3.client('s3') | |
for name in [bucket['Name'] for bucket in s3client.list_buckets()['Buckets']]: | |
if '10two1' in name: | |
continue | |
print(f'Deleting bucket[{name}]') | |
bucket = boto3.resource('s3').Bucket(name=name) | |
for item in bucket.objects.all(): | |
item.delete() | |
bucket.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment