Hosting a Static Website on Amazon S3

Log into your AWS account and create a bucket called www.yourdomain.com, be sure to include the www. at the beginning of the bucket name as this is important. Select what ever region works best for you, for me I'm picking US East.

Create a bucket

Enable static website hosting for the bucket under the Properties tab. Make not of the bucket endpoint URL.

Enable static website hosting

To allow this bucket to be publicly viewable, we need to edit the public access settings and bucket policy, under the permissions tab. In the "Public access settings", uncheck "Block new public policies". In "Bucket policy", copy and paste the json data below. Be sure to replace yourdomain in the policy with your own domain name.

public access settings

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"AddPerm",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::www.yourdomain.com/*"]
    }
  ]
}

At this point you should be able toa ccess your site via the endpoint bucker URL, assuming you also used US East as your region: http://www.yourdomain.com.s3-website-us-east-1.amazonaws.com