- On the S3 console, click "Create bucket".
- On the first page, enter a unique bucket name and preferred region.
- On the second page, accept all default settings.
- On the third page, uncheck "Block all public access".
- On the last page, review the settings and click "Create bucket".
- Click into the newly created bucket, and then click "Upload" to upload your static content.
- Select the "Properties" tab and then click "Static website hosting".
- Check "Use this bucket to host a website", enter the file name of the index document, and then click "Save".
- Select the "Permissions" tab and then click "Bucket policy".
- In the "Bucket policy editor", enter the following, replacing "${BUCKET_NAME}" with the name of your bucket, then click "Save":
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::${BUCKET_NAME}/*"
}
]
}
Your website is now available. To obtain the URL to your website, select the "Properties" tab, click "Static website hosting", and note the "Endpoint" URL listed at the top of the box.