Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Created January 1, 2021 06:00
Show Gist options
  • Select an option

  • Save thanakijwanavit/19588b9f12decd368b20a31610bc86cc to your computer and use it in GitHub Desktop.

Select an option

Save thanakijwanavit/19588b9f12decd368b20a31610bc86cc to your computer and use it in GitHub Desktop.
create s3 bucket with acceleration settings
import boto3
from botocore.exceptions import ClientError
bucket='filtered-df-sagemaker'
s3 = boto3.client('s3')
try:
s3.create_bucket(
Bucket=bucket,
CreateBucketConfiguration={'LocationConstraint':'ap-southeast-1'})
except ClientError as e:
print(e)
response = s3.put_bucket_accelerate_configuration(
Bucket=bucket ,
AccelerateConfiguration={
'Status': 'Enabled'
}
)
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment