Skip to content

Instantly share code, notes, and snippets.

@ryanthegiantlion
Created February 14, 2016 16:53
Show Gist options
  • Save ryanthegiantlion/d685fa2913fb8252f6a4 to your computer and use it in GitHub Desktop.
Save ryanthegiantlion/d685fa2913fb8252f6a4 to your computer and use it in GitHub Desktop.
create static website on s3 with awscli
aws s3 mb s3://test-website
aws s3 website s3://test-website --index-document index.html --error-document error.html
echo '{"Version":"2012-10-17", "Statement": [{ "Sid": "Allow Public Access to All Objects", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::test-website/*"}]}' > policy.json
aws s3api put-bucket-policy --bucket test-website --policy file://policy.json
aws s3 sync website-source-folder s3://test-website
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment