DEV Community

Cover image for Enable HTTPS with CloudFront for an S3 Static Website

Enable HTTPS with CloudFront for an S3 Static Website

Amazon CloudFront accelerates the delivery of static and dynamic web content to end users. To read more on what CloudFront does, check the official page here.

In this article, we will enable HTTPS on a static website hosted on Amazon S3.
Note: If a website is hosted on Amazon S3 static hosting, the default S3 website endpoint only supports HTTP.

Prerequisites:

  • Amazon account
  • Static website already hosted on S3 (Use this link to access my previous article on how to create a static website on Amazon S3)

Steps to follow:

  • Open the AWS console and log in.

  • Search for CloudFront in the search bar and click on create distribution.

Amazon console dashboard

create distribution

  • The free tier is sufficient for this learning purpose.

Free tier

  • Name your distribution and click next.

name distribution

  • Use the static website endpoint under origin.

static website endpoint

  • Review and create distribution.

create distribution

Voila! Your CloudFront distribution is ready for use.

distribution created

You can access your secured website using the CloudFront distribution domain name.

You can also take this further by adding a custom domain.

Thank you for reading to the end. Kindly reach out to me in the comment section if you have any questions, or on LinkedIn.

Till next time, cheers.

Top comments (0)