AWS Host Static Site On S3 - gecko-8/devwiki GitHub Wiki

  1. Open the AWS Console with a user that has S3 admin access (can create and configure buckets).
  2. Navigate to the S3 Console.
  3. On the list of buckets, click the Create Bucket button.
  4. Enter a bucket name (e.g. mysite.com).
  5. Make sure the correct region is selected.
  6. Under "Bucket Settings for Block Public Access" de-select "Block all public access".
  7. Click Create Bucket button at the bottom.
  8. Click on your new bucket.
  9. Copy the Amazon Resource Name (ARN) from the top of the page.
  10. Click on the Permissions tab.
  11. Click Edit next to the Bucket Policy section.
  12. Paste the following into the policy to enable public read-only access.
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "PublicReadGetObject",
                "Effect": "Allow",
                "Principal": "*",
                "Action": "s3:GetObject",
                "Resource": "arn:aws:s3:::vipgolf-admin-staging/*"
            }
        ]
    }
    
  13. Click Save Changes.
  14. Click the Properties tab.
  15. Scroll to the bottom and click Edit next to Static Website Hosting.
  16. Select the Enable radio button.
  17. Set Index Document to index.html.
  18. Set Error Document to the correct page (usually index.html for SPAs like Vue or React).
  19. Click Save Changes.