DEV Community

Abhishek Anand Amralkar
Abhishek Anand Amralkar

Posted on

1 2

Unspecified Location Constraint

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

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free