Created
January 5, 2018 14:59
-
-
Save atrakic/b86698b1a1c4d1d8e83ed0663b57baf1 to your computer and use it in GitHub Desktop.
This file contains 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/python | |
import boto3 | |
import argparse | |
parser = argparse.ArgumentParser(description='delete s3 bucket incl versions.') | |
parser.add_argument('-b','--bucket', help='s3 bucket name',required=True) | |
args = parser.parse_args() | |
BUCKET = args.bucket | |
print (BUCKET) | |
s3 = boto3.resource('s3') | |
bucket = s3.Bucket(BUCKET) | |
bucket.object_versions.delete() | |
# bucket.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment