11

I have created an Amazon Web Services S3 bucket in the past, without specifying the geographic region for it to be stored in. How do I determine which region the bucket is located in?

My reason for asking, is that I am preparing to run some "Amazon Elastic MapReduce" jobs on the data in the bucket, and this service asks me in what region I want the job to run. As it seems reasonable to run the job as close to the data as possible, I would like to know where to data actually is.

The options in Elastic MapReduce are:

  • US East (Virginia)
  • US West (N. California)
  • EU West (Ireland)

I am not if these are the exact same locations available in S3. Anyways, I would like to identify the one that is at least closest to my data.

3 Answers 3

6

Unless you specified something else, it'll be North America.

If you log in to Amazon web services, and view your usage report, it'll tell you whether it's EU / US or something other.

From reading the Amazon S3 / MapReduce stuff, the regions are different between the two apps, so you probably want to stick to either EU or US (rather than east or west).

Cheers

1
  • Good idea - the usage reports confirms that my data is somewhere in the US. Jan 27, 2010 at 13:43
3

You can use the GET Location Bucket request. Most probably your bucket is in US.

2
  • With no location constraint set, this command returns nothing: <LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/> Jan 27, 2010 at 13:28
  • According to the docs ... "When the bucket's region is US East (N. Virginia), Amazon S3 returns an empty string for the bucket's region"
    – james
    Mar 24, 2018 at 16:22
2

For anyone else who comes across this looking for a way to determine the region of a bucket, regardless of whether you're the bucket owner (which is a constraint of GET bucket location), use HEAD Bucket, e.g.:

curl -sI foo.s3.amazonaws.com | awk '/^x-amz-bucket-region:/ { print $2 }'

which returns the value of the header x-amz-bucket-region for the bucket "foo", in this case:

us-east-1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.