Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Created November 3, 2016 21:00
Show Gist options
  • Save StoneCypher/023dc2e0211e4c8e6b1f9941a01560ea to your computer and use it in GitHub Desktop.
Save StoneCypher/023dc2e0211e4c8e6b1f9941a01560ea to your computer and use it in GitHub Desktop.

To make an S3 bucket serve a website,

  1. go to your bucket in aws
  2. to properties
  3. open static website hosting
  4. hit enable website hosting
  5. set index document to index.html (possibly set error document too)
  6. add the bucket policy below, with your bucket's name swapped in
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "PublicReadGetObject",
			"Effect": "Allow",
			"Principal": "*",
			"Action": [
				"s3:GetObject"
			],
			"Resource": [
				"arn:aws:s3:::your-bucket-name-here/*"
			]
		}
	]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment