Create CloudFront Distribution

Create CloudFront Distribution

  1. Go to CloudFront on the AWS console and click Create a CloudFront Distribution.

Create CloudFront Distribution

  1. Configure the default source for the previously created S3 bucket and grant CloudFront access to the bucket using the Origin Access Identity setup:

    • Origin domain > Select your S3 bucket
    • Access S3 bucket > Yes using OAI (bucket can limit access only to CloudFront)

Create CloudFront Distribution

  1. Origin access identity

    • Click Create new OAI

Create CloudFront Distribution

    • In the displayed dialog, click Create

Create CloudFront Distribution

  1. Policy bucket > Yes, update the bucket policy

Create CloudFront Distribution

  1. Configure the Default Cache Behavior as follows:

    • View protocol policy > Redirect HTTP to HTTPS.

Create CloudFront Distribution

  1. Cache key and origin requests

    • Cache policy and origin request policy (recommended)
    • Cache policy > CachingOptimized (Recommended for S3 source) CloudFront provides a set of managed cache policies that you can attach to any cache behavior of your distribution. With a managed cache policy, you don’t need to write or maintain your own cache policy. Management policies use settings optimized for specific use cases.

Create CloudFront Distribution

  1. In the Settings section:

    • In this lab you will use a domain name provided by CloudFront, however, if you want to use your own domain name, you can configure it with Alternate Domain Names , you can add a new entry in the section Alternate domain name (CNAME) - optional.
    • Configure the Default root object - optionally index.html- And leave all remaining values ​​as default

Create CloudFront Distribution

  1. Click Create distribution

Create CloudFront Distribution

  1. Create a successful CloudFront distribution.

Create CloudFront Distribution

  1. CloudFront starts creating the distribution and it usually takes 5 to 10 minutes to fully deliver. The status of the delivery will be In Progress.

    • To check the status, you can click on the Distribution menu on the left sidebar.

Create CloudFront Distribution