If I have a bucket named mybucket
in region=us-east-1
, then I can access it using
aws s3 ls s3://mybucket --region=us-east-1
As @michael-sqlbot commented, URL and URI are not the same thing.
The S3 URL you referenced is actually an S3Uri as mentioned here.
S3Uri: represents the location of a S3 object, prefix, or bucket. This must be written in the form s3://mybucket/mykey where mybucket is the specified S3 bucket, mykey is the specified S3 key.
In information technology, a Uniform Resource Identifier (URI) is a string of characters used to identify a resource. Such identification enables interaction with representations of the resource over a network, typically the World Wide Web, using specific protocols. Schemes specifying a concrete syntax and associated protocols define each URI.
A Uniform Resource Locator (URL), commonly informally termed a web address (a term which is not defined identically) is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI), although many people use the two terms interchangeably.
According to the the definition of what a URI is, it is defined by the scheme designed for it. And, the scheme defined for it in this case, does not include a reference for region.
So the format for the URI would be correct, even if viewed by others as incomplete.
A URL is intended to help you locate an object somewhere, where as a URI is intended to reference an object and not necessarily locate it.
The proper way to include the S3 region for a bucket is to include it in the URL properly.
Note: "s3.amazonaws.com" is often mis-used when referencing buckets in regions outside of us-east-1. It can be, and often is used to do so. But, doing so makes knowing which region you are actually operating in less obvious, and this can be problematic in some scenerios.
If you wanted to specifically reference a bucket called "mybucket" in us-east-2 then the best way to do this is one of the following:
Host-Style Naming: http://mybucket.s3-us-west-2.amazonaws.com
Path-Style Naming: http://s3-us-west-2.amazonaws.com/mybucket
In either one of those examples, you will always connect to us-west-2 when referencing "mybucket".
There is no provision in the s3://
scheme for encoding the region.
Note also that the "U" in URL stands for uniform, not universal.