Skip to content
Black Friday

20% off for every Pro licenses

BLACKFRIDAYClaim the Offer
Contact us

Amazon CloudFront

This guide puts CloudFront in front of your bucket and connects it to Media Cloud Sync. CloudFront works with any bucket that has a public URL, and works best with Amazon S3.

AWS changes its console from time to time. If a screen looks different, follow the linked AWS guide for that step.

Step 1: Create the distribution

  1. In the CloudFront console, click Create distribution.
  2. Set the origin to your bucket’s address, such as my-bucket.s3.us-east-1.amazonaws.com.
  3. Choose how CloudFront reads the bucket:
  4. Create the distribution and copy its domain name, such as d1234abcd.cloudfront.net.

If your media needs CORS (fonts, SVGs, or video), use the managed CORS-S3Origin origin request policy on the behavior, so the Origin header reaches the bucket. See AWS’s managed origin request policies, and turn on Bucket CORS PRO.

Step 2: Add your own domain (optional)

To serve from media.example.com instead of the cloudfront.net address:

  1. Add the domain to the distribution as an alternate domain name.
  2. Attach an SSL certificate for it. CloudFront needs the certificate to be in AWS Certificate Manager in the us-east-1 region.
  3. Create a CNAME DNS record pointing the domain to the distribution’s domain name.

Step 3: Connect it to Media Cloud Sync

  1. Go to Media Cloud Sync → Settings and click Change on the Delivery card.
  2. Choose Amazon CloudFront.
  3. Enter your domain under Use Custom Domain Name (CNAME), and click Save.
  4. Click Recheck on the Delivery card. It should say Objects are accessible to Read.

Step 4: Clear stale files (optional) PRO

Connect CDN Cache Purge with your Distribution ID, so files uploaded again under the same name are cleared. On Amazon S3 storage, it can use your S3 storage keys if they’re allowed to create invalidations. Otherwise enter separate keys.

Private Media PRO

With Amazon S3 storage, private files can be served through CloudFront signed URLs. You need a key group, a behavior for the private path restricted to it, and an OAC on the S3 origin. See Private Media behind a CDN.

Related