Advertisement
Javi

AWS: create new public website

Feb 28th, 2018
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. # Create public website on S3
  2.  
  3. ## CLI commands
  4.  
  5. aws s3api create-bucket --bucket <bucket> --acl public-read --create-bucket-configuration LocationConstraint=<region> --region <region>
  6. aws s3 cp index.html s3://<bucket> --acl public-read
  7. aws s3api put-bucket-website --bucket <bucket> --website-configuration file://config.json
  8.  
  9. ## Endpoint
  10.  
  11. http://<bucket>.s3-website.<region>.amazonaws.com/
  12.  
  13. ## config.json
  14.  
  15. ``` json
  16. {
  17. "IndexDocument": {
  18. "Suffix": "index.html"
  19. },
  20. "ErrorDocument": {
  21. "Key": "error.html"
  22. }
  23. }
  24. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement