PART 1: Create and deploy a CF distribution with S3 origin

Ref: https://learn.cantrill.io/courses/1820301/lectures/41301527

  1. Deploy CFN stack provided with demo (S3 bucket with static website hosting)
  2. Create a new CF distribution, set origin domain name to the created S3 bucket
  3. You can leave default values for most settings (restrict viewer access, viewer protocol policy, cache policy…)
  4. ❗ Set the root default object to index.html
  5. Deploy the distribution (can take a while)

PART 2: Test the CF distribution

Ref: https://learn.cantrill.io/courses/1820301/lectures/41301528

  1. Notice your assigned default distribution name (ends in cloudfront.net)
  2. Open the distribution in your browser, refresh it a few times
  3. Modify the merlin.jpg image in the S3 bucket (you can substitute it with an image of Whiskers, but make sure the new image has the same name merlin.jpg)
  4. If you refresh the CF distribution tab in your browser, notice that the original image is still being loaded instead of the updated image (because it's cached)
  5. If you have an app where objects must be updated regularly, consider:
  6. Notice how CF distribution can use HTTPS, whereas default endpoint for S3 static website can only use HTTP (if you force HTTPS there, it doesn't load)