Left sidebar

Amazon CloudFront (WID:20200803144648-cloudfront)

Last modified: 1 Sep 2020

Cloudfront is a Amazon Web Services service which provides a CDN functionality for data hosted on AWS.

It is also commonly used as a front for web assets hosted on S3.

Using a custom domain with CloudFront

See here for the complete documentation.

Basically, we just need to add the name as an Alternate Domain Name for the distribution, and create a rule in the domain\'s DNS so that requests are routed to the CloudFront domain provided by AWS.

From CloudFront\'s documentation:

Use the method provided by your DNS service provider to add a CNAME record for your domain. This new CNAME record will redirect DNS queries from your domain (for example, www.example.com) to the CloudFront domain name for your distribution (for example, d111111abcdef8.cloudfront.net). For more information, see the documentation provided by your DNS service provider.

However, it is very possible that we also want to use a free certificate given by Amazon Certificate Manager for this. If this is the case then we first need to request the certificate so that the domain can be used, before adding the domain can be added as a valid alternate domain.