iam-veeramalla / iam-veeramalla/python-for-devops

Resolved the IllegalLocationConstrationException while creating Bucket in us-ease-1 region

Open
#45 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.8k
Forks
10.3k
PR merge metrics
No merged PRs in 30d

Description

### **Creating S3 bucket using Boto3**
I was creating an S3 bucket but, Exception **IllegalLocationConstrationException.** By default S3 bucket was created in US-east-1 region.
To solve this Exception, I provided the location to the bucket ap-south-1 and s3 bucket created successfully.

Here is the code:

import boto3

client = boto3.client('s3')

response = client.create_bucket(

Bucket='',
CreateBucketConfiguration={'LocationConstraint': 'ap-south-1'}


)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.