Skip to content
a CloudFormation script that does a static file hosting
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A CloudFormation script that does simple static file hosting on S3.


  • Create two buckets, a main one for the specified domain name and another for www. plus that domain
  • Sets up index.html and 404.html as the main bucket's index and errors documents
  • Grants all S3 actions to an identified ‘deploy user’ to the main S3 bucket
  • Grants read access to everyone in the world to the main S3 bucket
  • Redirects all requests from www. to the main domain


  1. Login to your AWS console
  2. Go to Identify & Access Management
  3. Create a new user and download its access and secret keys, remember what you called your user
  4. Select the region in which you wish to host your S3 bucket in
  5. Go to CloudFormation, click create stack
  6. Download the contents of — you may be able to alt+click this link.
  7. In Select Template, choose Upload a template to Amazon S3 and choose the file you just downloaded and click Next
  8. In Stack name enter a sensible name (it doesn't matter), in DomainName enter the domain name of your website, and in IAMDeployUser enter the name of the user you created in step 3, click Next
  9. Click Next again and click Create
You can’t perform that action at this time.