Skip to content

Instantly share code, notes, and snippets.

@ginokent
Last active March 14, 2019 01:46
Show Gist options
  • Save ginokent/2946942945b1aabbc1cb3e0db8d58850 to your computer and use it in GitHub Desktop.
Save ginokent/2946942945b1aabbc1cb3e0db8d58850 to your computer and use it in GitHub Desktop.
バージョニングが有効化されている S3 バケットの削除
#!/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