Created
August 8, 2019 12:58
-
-
Save joec4i/856ef7a616e4b4812b4c13d04ca7b234 to your computer and use it in GitHub Desktop.
A Python script to delete s3 bucket with 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
import boto3 | |
boto3.set_stream_logger('boto3.resources.action') | |
session = boto3.Session() | |
s3 = session.resource(service_name='s3') | |
bucket = s3.Bucket('bucket-name') | |
bucket.object_versions.delete() | |
bucket.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment