LoginSignup
7
7

More than 5 years have passed since last update.

独自ドメインの静的サイトをS3で公開する

Posted at

Management Consoleを使って操作。

Bucketの作成

  • Create Bucketを押す。(loggingを有効にする。)
  • Bucket Name: snippets.itayan.com / Region: Tokyo
  • Createを押す。

Static Website Hostingの有効

  • Propertiesを押す。
  • 「Static Website Hosting」を選択する。
  • 「Enable website hosting」にチェックを入れる。
  • Index Document: index.html / Error Document: error.html
  • Saveを押す。

Permissionsの設定

  • 「Permissions」を選択する。
  • Add bucket policyを押す。
  • 「Edit Redirection Rules」を選択し、テキストボックスにアクセスを許可するルールを追加する。
{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"AddPerm",
        "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::snippets.itayan.com/*"
      ]
    }
  ]
}
  • Saveを押す。

コンテンツのアップロード

  • Uploadを押す。
  • 画面にDrag and dropをする。
  • Start uploadを押す。

ページの表示

  • 「Static Website Hosting」を選択する。
  • EndpointのURLにアクセスする。

Route53の設定

  • Hosted Zonesを押す。
  • 対象ドメインを選択し、Go to Record Setsを押す。
  • Create Record Setを押す。
Name: snippets
Type: A - IPv4 address
Alias: Yes
Alias Target: s3-website-ap-northeast-1.amazonaws.com
  • Createを押す。

ページの表示
http://snippets.itayan.com

参考リンク

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