Unspecified Location Constraint
Abhishek Anand Amralkar

Abhishek Anand Amralkar @abhishekamralkar

About: Abhishek leads the Cloud Infrastructure / DevSecOps team where he designs the next generation of Cloud Infrastructure in a cost-effective and reliable manner without comprising

Location:
Pune
Joined:
Mar 6, 2017

Unspecified Location Constraint

Publish Date: Apr 17 '20
5 0

I was creating an AWS S3 bucket using AWS CLI, but I was getting below error while creating bucket

Problem:

Command:-
aws s3api create-bucket --bucket abhishek-qa-state-store --region us-west-2                                                                                                                                    
Error:-
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:

For any other region than us-east-1 in AWS, we need to define the LocationConstraint. Below is the command which will create a bucket for you in any other region apart from us-east-1

Command:-
aws s3api create-bucket --bucket abhishek-qa-state-store --region us-west-2 --create-bucket-configuration LocationConstraint=us-west-2                                                                         
Output:-
{
    "Location": "http://abhishek-qa-state-store.s3.amazonaws.com/"
}

More info available here

AWS S3 Location Constraint

Comments 0 total

    Add comment