0
votes

I prepare to aws certification and found an answer:

Which is a valid bucket url for mybucket?
Answers
A. http://s3-sa-east-1.amazonaws.com/mybucket
B. http://s3.amazonaws.com/mybucket
C. All of the above

Right answer is C, but I am not agree with it. I don't see variant of backet url without region: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro. But on the other side - bucket name is unique globally, so, what is the sense to write bucket-region if you provide bucket name?

So, which answer is correct?

2

2 Answers

1
votes

Bucket url without region is Legacy Global Endpoint still used N. Virginia region.

S3 is a regional service, though bucket names are global. Since its regional service, using url endpoint with the address directs all your queries to the endpoint in the same region as your data.

1
votes
A. http://s3-sa-east-1.amazonaws.com/mybucket

A. is correct. Some older Amazon S3 Regions support endpoints that contains a dash between S3 and the Region instead of a dot.

B. http://s3.amazonaws.com/mybucket

B. is using the legacy global endpoint and therefore is implicitly us-east-1 (N. Virginia) Region.

From the doc:

For the US East (N. Virginia) Region, the legacy global endpoint can be used for path-style requests.

For all other Regions, the path-style syntax requires that you use the Region-specific endpoint when attempting to access a bucket. If you try to access a bucket with the legacy global endpoint or another endpoint that is different than the one for the Region where the bucket resides, you will receive an HTTP response code 307 Temporary Redirect error and a message indicating the correct URI for your resource. For example, if you use https://s3.amazonaws.com/bucket-name for a bucket that was created in the US West (Oregon) Region, you will receive an HTTP 307 Temporary Redirect error.

So the right answer is

C. All of the above