Create distribution in CloudFront

Set Up CloudFront

In the main interface:

  • Search for CloudFront.
  • Select CloudFront.

6-host-web-application

You will see the Distribution interface. Click Create distribution.

6-host-web-application

Here, we need to fill in a few details:

  • Origin: This is the endpoint of the S3 Bucket that holds the web application content (in this case, imga-website).
  • Name: It will be automatically generated, or you can assign a custom name here.
  • Origin access:
    • Select Legacy access identities.
    • Click to create a new OAI (Origin Access Identity), as the S3 Bucket needs to know which principal is accessing its resources. Here, we create an OAI so that we can later configure the resource-based policy.
    • Then, select Yes, update the bucket policy.

6-host-web-application

Next, leave the following configurations as default.

6-host-web-application

And these configurations as well.

6-host-web-application

In the Web Application Firewall (WAF) section, turn off the firewall feature since we won’t be using it in this workshop. Under the Settings section:

  • Price class: Choose “Use all edge locations” (to distribute to all Edge Locations for optimal performance).
  • Default root object: Set to index.html.
  • Leave the remaining configurations as default.

6-host-web-application

Once created, you will see that the distribution is being deployed to the Edge Locations.

6-host-web-application