skulltech/aws-solutions-architect-associate-notes

bucket formats not 100% right

mlennon-spr opened this issue · 6 comments

http://www.wryway.com/blog/aws-s3-url-styles/

The URL's are mostly with s3- instead of s3. except for a few exceptions

S3 endpoints

Before describing S3 bucket URL schemes, one thing that causes a lot of the confusion needs to be clarified. And that thing is S3 endpoint.

S3 endpoint is a region-specific URL that is used in both S3 URL styles (more on styles below). Follow the link to see the list of all S3 endpoints.

Most of the endpoints follow this pattern (with region names being eu-west-1, us-west-2, etc):

    s3-REGION.amazonaws.com

Examples:

    s3-eu-west-1.amazonaws.com
    s3-us-west-2.amazonaws.com

But there are a few quirks to the general naming scheme.

The first two outstanding endpoints that do not follow the above pattern are those of the us-east-1 (N. Virginia, also called US Standard) region. For that region endpoints are (they are synonyms and both point to the same place):

    s3.amazonaws.com
    s3-external-1.amazonaws.com

The other quirk is that eu-central-1 (Frankfurt) and ap-northeast-2 (Seoul) regions both have one endpoint that follows the general pattern and one alias endpoint that differs from the general scheme in one symbol (first dash is replaced by dot):

    s3-eu-central-1.amazonaws.com
    s3.eu-central-1.amazonaws.com

    s3-ap-northeast-2.amazonaws.com
    s3.ap-northeast-2.amazonaws.com

The AWS docs here don't mention anything like that. Moreover, as an example they've used

https://my-bucket.s3.us-west-2.amazonaws.com

Which according to that blog post should not be allowed. I won't make any changes right now, as I don't have any solid evidence that the blog post is right.

I believe this is a case of the documentation by AWS not being comprehensive. If you look at actual bucket names, you can see there are differences in naming.

This site lists public bucket names in many regions: https://buckets.grayhatwarfare.com/buckets

You can see most of the buckets are named with s3-region, like elktesting.s3-us-west-1.amazonaws.com

Some other buckets have s3.region like website-admin.s3.us-east-2.amazonaws.com

I see. Okay, I'll try creating a bucket and testing out all the endpoints myself.

@mlennon-spr I tried and it seems like both of those formats work, and I'd guess that's true for all of the regions as I tried with two random regions. Does that sound right to you? I'll go ahead and add that in that case.

I don't know if it is for all regions, but yes more than a couple at least support both formats. I wish AWS would provide better documentation about that

I just tested with two more regions, and now I'm pretty sure both of them work for all regions. And yeah, AWS should mention this in their documentation. Maybe they want to deprecate it eventually, so stopped mentioning it. Anyway, it's working now so I'll update the repo.

FYI, AWS will stop supporting the URL path format for buckets created after September 30, 2020. Read this for details.