Setup CloudFront for Client App

akbarnafisa

Akbar Nafisa

Posted on January 4, 2024

Setup CloudFront for Client App

In the previous section, we uploaded our client's static files to S3. However, we still cannot access them because we set our bucket to be private. In this section, we will create CloudFront as a CDN and connect it to our static site. To do so, let’s follow these steps:

Create CloudFront

  • Open the CloudFront dashboard and click on the Create distribution button.

Image description

  • Select the static site bucket in the Origin domain.

Image description

  • In the Origin access section, select Legacy access identities and then click on Create new OAI.

Image description

  • Enter the OAI name and click Create button

Image description

  • Next, select the Yes, update the bucket policy option to automatically add a new bucket policy inside our S3 bucket.

Image description

  • In the Viewer section, select the Redirect HTTP to HTTPS option.

Image description

  • Finally, select Do not enable security protections in the WAF section and click the create button at the bottom of the page.

Image description

  • The deployment will take several minutes; you can visit the client app here.

Image description

Image description

💖 💪 🙅 🚩
akbarnafisa
Akbar Nafisa

Posted on January 4, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Add Portainer Stack
webdev Add Portainer Stack

January 26, 2024

Setup EC2 Instance
webdev Setup EC2 Instance

December 19, 2023

Setup CloudFront for Client App
webdev Setup CloudFront for Client App

January 4, 2024

Create Access Key for AWS S3
webdev Create Access Key for AWS S3

December 29, 2023