The first thing you need is an Amazon Web Services account, if you freshly opened it, congratulations you still qualify for their ‘Free-Tier’ program. See here for more information.
I am writing form memory what I just did, so I am not taking responsability for any costs that might occur if you fudge up the confs :) OFC this will cost you some money, pls make sure you read up on the prices and are aware how much it will cost you
- Buy via the Amazon - Route 53 a domain
- Create a bucket that is preferably named as your domain. (http://www.example.com -> www.example.com
- Create via ‘AWS Certificate Manager’ a certificate for all domains you wish to serve from your CloudFront (to be sure do it for both www.exmaple.com and example.com)
- Confirm for each domain that you requested that you actually did, you should receive emails with a link you have to click
- Create an Amazon CloudFront distribution
- Set ‘Default Root Object’ (for example as index.html
- Set ‘Alternate Domain Names (CNAMEs)’ (all the domains you wish to serve from this Amazon Cloudfront.
- Set ‘Viewer Protocol Policy’ to forward http to https.