title: creating bucket error on AWS using python
body: <p>I want to create a bucket to upload some wav files in it. I am able to create a bucket manually with location required, but when I am trying to program in python to create a bucket with us-west-2 location</p>
  
  <pre><code>session = boto3.Session(aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key)
  s3 = session.resource('s3')
  
  s3.create_bucket(Bucket='test-asterisk1', CreateBucketConfiguration={'LocationConstraint': 'eu-central-1'})
  </code></pre>
  
  <p>I got the following error</p>
  
  <pre><code>Traceback (most recent call last):
    File "create_bucket.py", line 10, in &lt;module&gt;
    s3.create_bucket(Bucket='asterisk1', CreateBucketConfiguration={'LocationConstraint': 'ap-south-1'})
    File "/home/dileep/.local/lib/python2.7/site-packages/boto3/resources/factory.py", line 520, in do_action
  response = action(self, *args, **kwargs)
    File "/home/dileep/.local/lib/python2.7/site-packages/boto3/resources/action.py", line 83, in __call__ response = getattr(parent.meta.client, operation_name)(**params)
    File "/home/dileep/.local/lib/python2.7/site-packages/botocore/client.py", line 314, in _api_call
  return self._make_api_call(operation_name, kwargs)
    File "/home/dileep/.local/lib/python2.7/site-packages/botocore/client.py", line 612, in _make_api_call
  raise error_class(parsed_response, operation_name)
  
  botocore.exceptions.ClientError: An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The ap-south-1 location constraint is incompatible for the region specific endpoint this request was sent to.
  </code></pre>
  
  <p>I am on indian IP trying to create a 'us-west-2' end point is that creating a problem?</p>
  
  <p>so I tried <a href="https://github.com/aws/aws-cli/issues/2603" rel="nofollow noreferrer">changing location constrain</a> one by one time each </p>
  
  <pre><code>"LocationConstraint": "EU"|"eu-west-1"|"us-west-1"|"us-west-2"|"ap-south-1"|"ap-southeast-1"|"ap-southeast-2"|"ap-northeast-1"|"sa-east-1"|"cn-north-1"|"eu-central-1"
  </code></pre>
  
  <p>but whatever location I try it gives me the same error. </p>
  
  <p>so I tried creating with boto instead of boto3 </p>
  
  <pre><code>import boto
  from boto.s3.connection import Location
  s3 = boto.connect_s3(aws_access_key_id, aws_secret_access_key)
  s3.create_bucket('test-asterisk1', location=Location.USWest2)
  </code></pre>
  
  <p>it throws error</p>
  
  <pre><code>File "s2t_amazon.py", line 27, in &lt;module&gt;
  s3.create_bucket('test-asterisk2', location=Location.USWest2)
  File "/home/dileep/.local/lib/python2.7/site-packages/boto/s3/connection.py", line 623, in create_bucket
  response.status, response.reason, body)
  boto.exception.S3CreateError: S3CreateError: 409 Conflict 
  &lt;?xml version="1.0" encoding="UTF-8"?&gt; 
  &lt;Error&gt;&lt;Code&gt;BucketAlreadyOwnedByYou&lt;/Code&gt;&lt;Message&gt;Your previous request to create the named bucket succeeded and you already own it. 
  &lt;/Message&gt;&lt;BucketName&gt;test-asterisk2&lt;/BucketName&gt; 
  &lt;RequestId&gt;EAF26BA152FD20A5&lt;/RequestId&lt;HostId&gt;ep0WFZEb1mIjEgbYIY4BGGuOTi5HSutYd3XTKgFjWmRMnGG0ajj5TLF4/t1amJQsOZdZQrqGnoE=&lt;/HostId&gt;&lt;/Error&gt;
  </code></pre>
  
  <p>I have checked if the bucket is created, and it is not created by anyone of the methods. Can anyone suggest what could be the problem? </p>