Created: Apr, 2016
This tutorial shows the work flow of building a HTTP-only static website hosted on AWS S3, with the option of using a continous integration (CI) service like Wercker. The website content will be directly sourced from a AWS S3 bucket. One can also use Amazon CloudFront for content delivery, which is decribed in this post.
Obviously, you need to register for an AWS account if you haven’t. AWS provides a bunch of services and the number is growing, but below is a subset for this tutorial:
Here I build a static website with the domain name “example.com”.
The idea is to create two S3 buckets, with one named “example.com” hosting the website content and the other being “www.example.com” with no content which redirects to “example.com”. It is suggested to name the S3 buckets with names like “example.com” above because it is will be a unique AWS-wide identifier.
Pricing-wise, you will be charged with both storage and traffic on S3 (see S3 pricing).
Follow this example in AWS documentation on setting up a simple static website with custom domain. The steps are:
http://example.com.s3-website-us-east-1.amazonaws.com
.Follow this example to get an AWS access key ID and key secret pair. After that, attach an IAM policy to grant user the access to the corresponding S3 bucket. For convenience, I use “AmazonS3FullAccess” policy since it is an one-man project. But you may need to be more careful about the access assignment when there are multiple collaborators.
This part has been spinned off to another standalone post here. The goal is to reduce the process-specific overhead by automating the build and deploy so that you can concentrate on the content creation.