Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 Error: The specified bucket exists in another region

Tags:

I'm just setting up a simple splash page basic static HTML and I decided to put it on S3.

my bucket name is called the same as my domain

www.example.com.s3-website.eu-west-2.amazonaws.com/

And then I've got a CNAME set to the same thing.

the only problem is i'm getting a 400 error from Amazon S3

400 Bad Request

  Code: IncorrectEndpoint
  Message: The specified bucket exists in another region. Please direct 
  requests to the specified endpoint.

I've checked and my bucket is definitely EU West and this is the endpoint it's given me when serving a static site.

like image 806
Karl Taylor Avatar asked Jun 18 '17 10:06

Karl Taylor


People also ask

How do I access S3 bucket from another region?

You can set up a S3 Multi-Region Access Point in three simple steps. First, you will receive an automatically generated S3 Multi-Region Access Point endpoint name, to which you can connect your clients. Second, you will select existing or create new S3 buckets that you would like to route requests between.

Is S3 bucket specific to region?

Amazon S3 supports global buckets, which means that each bucket name must be unique across all AWS accounts in all the AWS Regions within a partition. A partition is a grouping of Regions.

Why does S3 not need Region selection?

But when we create S3 in AWS console in "Global" it says "S3 does not require a region selection" because it shows all the buckets in all the regions as it is the user interface and this is the reason why you can't create the bucket with same names as it may lead to conflicts between addresses.


1 Answers

You can check your bucket location through the following command.

aws s3api get-bucket-location --bucket {bucketname}

Could it be, that your bucket is located in eu-west-1 instead of eu-west-2?

like image 107
jens walter Avatar answered Sep 30 '22 00:09

jens walter