Create Bucket

S3

  1. Sign in to the AWS Management Console and open the S3 console at https://console.aws.amazon.com/s3/.

For S3 and Cloudfront there is slightly different configuration depending if the site is a SPA or a traditional layered website with a nested folder setup.

Single Page App

  1. Very easy setup here. Create a new bucket and call it your domain name (note you can call the bucket anything really for an SPA but for consistency I find it good to use a common naming approach as with regular websites)

New bucket

Traditional layered Site

  1. Create a new bucket and call it your domain name.
  • For static sites hosted in S3, to be used with cloudfront, the bucket name must match the domain name of the static site.

New bucket

  1. Allow public access to the bucket
  • Got to Permissions
  • Block public access
  • Uncheck the block all public access checkbox and save

Make public

  1. Turn on static website hosting
  • Go to properties
  • Static website hosting
  • Select Use this bucket to host a website

Host Static Website

We do need to set bucket policies to decide who can have access to our buckets contents. We will come back to this after setting up our cloudfront distribution.