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.
-
Open the CloudFront console at https://console.aws.amazon.com/cloudfront/
- Select Distributions
- Select Create distribution

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

-
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

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

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

- In the Settings section, configure these settings as picture below

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

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

- The distribution is created.

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

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