DEV Community

Akbar Nafisa
Akbar Nafisa

Posted on

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

Top comments (0)