Skip to content

Instantly share code, notes, and snippets.

@rhussmann
Last active April 11, 2017 17:04
Show Gist options
  • Save rhussmann/56bd5a73f1bfe311a8a780283954831d to your computer and use it in GitHub Desktop.
Save rhussmann/56bd5a73f1bfe311a8a780283954831d to your computer and use it in GitHub Desktop.
Creating an S3 static website from the command line
aws s3 mb s3://my-bucket-name
aws s3 website s3://my-bucket-name/ --index-document AN_INDEX_DOCUMENT --error-document AN_ERROR_DOCUMENT
aws s3api put-bucket-policy --bucket my-bucket-name --policy file://policy.json
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::my-bucket-name/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment