0

I'm currently using AWS Cloudfront to serve assets for a companies website under the subdomain content.companyname.com. The current distribution points to companyname.s3.amazonaws.com.

With this setup we lack some of the static website hosting features such as a custom index.html page and a error page. I understand from this answer that I need to point instead to http://companyname.s3-website-eu-west-1.amazonaws.com to get this to work.

My question is, can I just update the Origin without having to create a new Cloudfront distribution? Or is it better to create a new Cloudfront distribution then change the DNS and associate our custom CNAME with it?

We are ideally looking to have zero downtime if possible.

Pete Dermott
  • 663
  • 1
  • 9
  • 20

1 Answers1

0

Create a second Origin on the CloudFront distribution, pointing to the new endpoint.

Then you can update each Cache Behavior and select the new origin from the drop-down, and save changes.

If your bucket is correctly configured, this change will take effect over the course of a few minutes, without any downtime.

Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427