Created
April 11, 2023 11:47
-
-
Save ezaurum/acc93d13ae5cdef5812672519f4a6fe6 to your computer and use it in GitHub Desktop.
Emptify S3 bucket
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 | |
import boto3 | |
import sys | |
PROFILE = sys.argv[1] | |
BUCKET = sys.argv[2] | |
session = boto3.Session(profile_name = PROFILE) | |
s3 = session.resource('s3') | |
bucket = s3.Bucket(BUCKET) | |
bucket.object_versions.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment