Created
August 31, 2017 11:35
-
-
Save julcap/d263cacec04320b9389d1ac3d925278a to your computer and use it in GitHub Desktop.
Delete all bucket object versions
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/env python | |
BUCKET = 'your_bucket_name' | |
import boto3 | |
s3 = boto3.resource('s3') | |
for obj in s3.Bucket(BUCKET).object_versions.all(): | |
print(obj.delete()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment