When running:
aws s3api create-bucket --region eu-west-1 --profile xxx --bucket com-a
everything works, however when runing:
aws s3api create-bucket --region eu-west-1 --profile xxx --bucket com.a
I get:
A client error (IllegalLocationConstraintException) occurred when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.
But through Console it is possible to use dots.
If you want to create a bucket in eu-west-1 with the low level S3 API you have to use the --create-bucket-configuration
option
aws s3api create-bucket --bucket foo.bar --create-bucket-configuration LocationConstraint=eu-west-1
I think we bumped into this issue again, using boto3 (1.4.3)
To reproduce in a python repl:
import boto3
s3 = boto3.resource('s3')
b = s3.Bucket('test-with-d.0.t.s')
b.create()
fails with: "botocore.exceptions.ClientError: An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to."
b.create(CreateBucketConfiguration={ 'LocationConstraint': 'us-west-2' })
works -- the json that gets sent along for the API call has 'Location': 'http://test-with-d.0.t.s.s3.amazonaws.com/'
in it.
Most helpful comment
If you want to create a bucket in eu-west-1 with the low level S3 API you have to use the
--create-bucket-configuration
option