AWSS3

S3 Bucket – IllegalLocationConstraintException

A quick one !!
Creating bucket failed with “IllegalLocationConstraintException” —

[[email protected] ~]$ aws s3api create-bucket --bucket labtestrand --region us-west-2

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.
Solution —

[[email protected] ~]$
[[email protected] ~]$ aws s3api create-bucket --bucket labtestrand --region us-west-2 --create-bucket-configuration LocationConstraint=us-west-2
{
"Location": "http://labtestrand.s3.amazonaws.com/"
}
[[email protected] ~]$

Leave a Reply