Skip to content

Instantly share code, notes, and snippets.

@jaywon
Created October 19, 2017 05:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaywon/10ecac83ecbe8878edf40b4237a56e41 to your computer and use it in GitHub Desktop.
Save jaywon/10ecac83ecbe8878edf40b4237a56e41 to your computer and use it in GitHub Desktop.
Static Site Hosting Setup and Deployment with AWS CLI

Create Bucket

aws s3api create-bucket --bucket website-bucket-name --region us-west-2 --acl public-read --create-bucket-configuration LocationConstraint=us-west- 2

Make Bucket A Static Website

aws s3 website s3://website-bucket-name/ --index-document index.html --error-document error.html

Sync Local Project Directory to Static Website Bucket

aws s3 sync projectfolder s3://website-bucket-name --acl public-read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment