While creating the bucket using the s3api , the bucket creation fails with the error message
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.
The error message came specifically in the Mumbai region but the same command was running in the singapore region
Not Working
aws s3api create-bucket --bucket bucketname --region ap-south-1
Working
aws s3api create-bucket --bucket bucketname --region ap-southeast-1
The reason for this error is creating additional parameters which needs to be passed in the mumbai for bucket creation using the s3api i.e. --create-bucket-configuration and LocationConstraint=ap-south-1. Once you pass it you should be able to create the bucket at command line
Working
aws s3api create-bucket --bucket bucketname --region ap-south-1 --create-bucket-configuration LocationConstraint=ap-south-1
Output
{
"Location": "http://bucketname.s3.amazonaws.com/"
}
0 comments:
Post a Comment