Last active
March 14, 2019 01:46
-
-
Save ginokent/2946942945b1aabbc1cb3e0db8d58850 to your computer and use it in GitHub Desktop.
バージョニングが有効化されている S3 バケットの削除
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import boto3 | |
from boto3.session import Session | |
boto3.set_stream_logger() | |
session = Session(profile_name='YOUR_AWS_PROFILE_NAME') | |
s3 = session.resource('s3') | |
bucket = s3.Bucket('YOUR_S3_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