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
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".