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 | |
from botocore.exceptions import ClientError | |
s3_client = boto3.client('s3') | |
s3_bucket = boto3.resource('s3') | |
bucket_name = raw_input('Enter the name of the bucket that you want to enable MFA-delete on: ') | |
mfa_token = raw_input('Enter your MFA serial number and token code, e.g. <deviceSerialNumber> <tokenCode>: ') | |
try: | |
s3_bucket.meta.client.head_bucket(Bucket=bucket_name) |