Amazon CloudFront

Table of Contents

Settings

Topics

Price Class

Price Classes let you reduce your delivery prices by excluding Amazon CloudFront’s more expensive edge locations from your Amazon CloudFront distribution.

Ensure users S3 content only through Cloudfront

  1. Create originaccessidentity
  2. Allow this identity to access your private S3 bucket by updating bucket policy

  3. Set the identity to the cloudfront distribution.

Zone ID of CloudFront Distributions

It's globally a single one, which is Z2FDTNDATAQYW2

How-to

Use custom domain and its ACM (AWS Certificate Manager)

You must list any custom domain names (for example, www.example.com) that you use in addition to the CloudFront domain name (for example, d1234.cloudfront.net) for the URLs for your files. Specify up to 100 CNAMEs separated with commas or put each on a new line. You also must create a CNAME record with your DNS service to route queries for www.example.com to d1234.cloudfront.net. For more information, see the Help.

If you want to use ACM for both apex domain and subdomains, you should specify apex domain(example.com) along with wildcard domain(*.example.com) when you create ACM

Redirect HTTP to HTTPS

Within Behaviros tab:

Invalidate objects (Web Dist Only)

Or you can use awscli as follows:

aws cloudfront create-invalidation --distribution-id <ID> --paths '/*'