Created
January 1, 2021 06:00
-
-
Save thanakijwanavit/19588b9f12decd368b20a31610bc86cc to your computer and use it in GitHub Desktop.
create s3 bucket with acceleration settings
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
| 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