AWS Host Static Site On S3 - gecko-8/devwiki GitHub Wiki
- Open the AWS Console with a user that has S3 admin access (can create and configure buckets).
- Navigate to the S3 Console.
- On the list of buckets, click the Create Bucket button.
- Enter a bucket name (e.g. mysite.com).
- Make sure the correct region is selected.
- Under "Bucket Settings for Block Public Access" de-select "Block all public access".
- Click Create Bucket button at the bottom.
- Click on your new bucket.
- Copy the Amazon Resource Name (ARN) from the top of the page.
- Click on the Permissions tab.
- Click Edit next to the Bucket Policy section.
- 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/*" } ] }
- Click Save Changes.
- Click the Properties tab.
- Scroll to the bottom and click Edit next to Static Website Hosting.
- Select the Enable radio button.
- Set Index Document to index.html.
- Set Error Document to the correct page (usually index.html for SPAs like Vue or React).
- Click Save Changes.