LoginSignup
63
63

More than 5 years have passed since last update.

S3のバケットURL(仮想ホスト形式とパス形式)

Last updated at Posted at 2015-03-11

S3のバケットにアクセスするには2つの形式のURLがある。
仮想ホスト形式(virtual-hosted-style)とパス形式(path-style)である。

仮想ホスト形式

バケットがどのリージョンにあっても下記の形式でアクセスできる。

http://bucket.s3.amazonaws.com

リージョンごとのエンドポイントでもアクセスできる。
下記は東京リージョンの場合。

http://bucket.s3-ap-northeast-1.amazonaws.com

パス形式

パス形式の場合は仮想ホスト形式と違ってリージョンの指定が必須。
US Standard endpointの場合。

http://s3.amazonaws.com/bucket

東京リージョンの場合。

http://s3-ap-northeast-1.amazonaws.com/bucket

注意点

ホスト名とアンスコ

バケット名を付ける時はドメインに含まれることを想定すること。
とりあえず、バケット名にアンスコは含めない方が無難。

Bucket Restrictions and Limitations
Virtual Hosting of Buckets

署名付きリクエストとリージョンなしURL

署名付きリクエストでS3にアクセスする場合リージョンを含まないURLだとSignature Version 4が使えない。
スコープの一部にリージョン情報を使ってるっぽい。
CloudFormationからS3にアクセスするとVer2にフォールバックする警告がでる。

Authenticating Requests by Using the Authorization Header (Compute Checksum of the Entire Payload Prior to Transmission) - Signature Version 4

63
63
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
63
63