Create distribution in CloudFront
Set Up CloudFront
In the main interface:
- Search for
CloudFront
. - Select CloudFront.
You will see the Distribution interface. Click Create distribution.
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.
Next, leave the following configurations as default.
And these configurations as well.
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.
Once created, you will see that the distribution is being deployed to the Edge Locations.