Closed hoon closed 3 years ago
There's potential to improve this, but I wanted to explain the error's your seeing, and at least why it's the current expected behavior.
client()
call is specifying which region to send the request to.create_bucket
and specifying the CreateBucketConfiguration
parameter. This is the only way to specify which region you want to create a bucket.The improvement we can make is to automatically inject the CreateBucketConfiguration
parameter on your behalf, with the correct values, if you don't provide one, based on the region you have configured. That way you'll always create a bucket in whatever region you're client is configured for.
The main area of concern is the fact that this is a change in default behavior and we'd need to make sure no one would be adversely affected. The error -> now working
case should be fine, but there's concern if anyone is relying on the behavior for creating a bucket in US Standard because they didn't specify a CreateBucketConfiguration
despite the fact that they might have us-west-2
configured.
Going to label this as needs-discussion for the time being.
There is also a special case regarding .
s in the desired bucket name. I've put more information on https://github.com/aws/aws-cli/issues/589 -- should I open up a new issue?
Also overlaps with #627 maybe
I get this error when I do Put Bucket encryption in my lambda script
An error occurred (IllegalLocationConstraintException) when calling the PutBucketEncryption operation: The ap-east-1 location constraint is incompatible for the region specific endpoint this request was sent to.: ClientError
Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.
Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.
When I try to create an S3 bucket on 'ap-northeast-2' using boto3, I get an IllegalLocationConstraintException:
My
.aws/config
is as followsIf I change the default region in
.aws/config
to 'ap-northeast-1', create_bucket() seems to work:But, when I go into the AWS web console, I see that 'this-will-work' bucket was created in 'US Standard,' not 'ap-northeast-1'.
It's possible to get around all these problems and create a bucket in 'ap-northeast-2' region by doing this:
and setting
.aws/config
default region to 'ap-northeast-2'. (If it's set to anything else, the above workaround will fail withIllegalLocationConstraintException
.In summary, boto3 seems to be exhibiting an odd behaviour where:
.aws/config
.aws/config
and creates bucket in 'US Standard' if the region is set to 'ap-northeast-1'The version of boto3 I'm using is 1.4.0.