Created
June 7, 2021 01:10
-
-
Save gabanox/4a84d984a7e4ac5d1d3ecacb4f1d54e3 to your computer and use it in GitHub Desktop.
Delete versions from a bucket in S3
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
import sys | |
import boto3 | |
s3 = boto3.resource('s3') | |
bucket = s3.Bucket(sys.argv[1]) | |
bucket.object_versions.delete() | |
bucket.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment