Create CloudFront Distribution

Create CloudFront Distribution

In this step, you create a CloudFront distribution that uses the S3 bucket from step 2.3 as its origin. The bucket stays private, and CloudFront gets read access through a bucket policy that the console creates for you.

  1. Open the CloudFront console at https://console.aws.amazon.com/cloudfront/

    • Select Distributions
    • Select Create distribution

Create CloudFront Distribution

  1. Open the S3 console and the bucket you created in step 2.3.
    • Select the checkbox next to index.html
    • Select Copy URL

Create CloudFront Distribution

  1. Go back to the CloudFront tab. On the Get started page, in Distribution options:

    • Distribution name: paste the URL you copied, then delete https:// at the start and /index.html at the end. The name should look like cloudfront-lab-<account-id>-<region>-an.s3.<region>.amazonaws.com
    • Description: leave empty
    • Distribution type: select Single website configuration
    • Leave the Domain section empty, scroll down and select Next

Create CloudFront Distribution

The distribution name is only a tag that helps you identify the distribution. You can change it later.

  1. Select Browse S3

Create CloudFront Distribution

  1. In the Select S3 location dialog, select the bucket then select Choose.

Create CloudFront Distribution

  1. In the Settings section, configure these settings as picture below

Create CloudFront Distribution

  1. Select Do not enable security protections, then select Next.

Create CloudFront Distribution

  1. On the Review and create page, check the settings again. Select Create distribution.

Create CloudFront Distribution

  1. The distribution is created.

Create CloudFront Distribution

  1. On the General tab, in the Settings section, select Edit.

Create CloudFront Distribution

  1. In Default root object, enter index.html, then scroll down and select Save changes.

Create CloudFront Distribution