Personal Website on AWS, Part 2: CloudFront & SSL
Turn the bare S3 site from Part 1 into a real HTTPS site on your own domain, served fast from CloudFront's edge network.
Photo by Christopher Gower on Unsplash*
This picks up right where Part 1 left off: a working static site on S3, but on an ugly S3 URL with no HTTPS. Three services fix that: CloudFront, Route 53, and AWS Certificate Manager.
Setting up CloudFront
CloudFront is a CDN: a geographically distributed network of edge locations that serves your content from whichever one is physically closest to the visitor, cutting latency everywhere.
- Open the CloudFront service
- Click Create Distribution
- Click Get Started
Origin settings
- Origin Domain Name: paste your S3 static-hosting endpoint, in the form
<BucketName>.s3-website.us-east-2.amazonaws.com - Leave everything else default
Default cache behavior
- Viewer Protocol Policy: set to Redirect HTTP to HTTPS
- Save
Deployment takes 15–30 minutes. Once it's done, the CloudFront link should serve your site.
Registering a domain in Route 53
Route 53 is AWS's DNS service: it's what routes requests for your domain to the CloudFront distribution.
- Open Route 53, then Registered Domains
- Click Register Domain
- Search for the domain you want and check the price
- Add it to the cart
- Enter your contact details
- Review and accept the terms
- Complete the order
Registration usually finishes within a couple of hours.
Pointing the domain at CloudFront
A hosted zone holds all the DNS records for your domain (A, CNAME, NS, etc.), and one gets created automatically when you register.
- Open Hosted Zones
- Click into your domain's zone
- Create an A record
- Toggle Alias, choose Alias to CloudFront Distribution
- Paste in your CloudFront domain name
- Click Create records
Getting a free SSL certificate
Without SSL, anything visitors submit to your site travels unencrypted — worth fixing before you share the link with anyone.
- Open AWS Certificate Manager, make sure you're in us-east-1 / N. Virginia, since that's the only region CloudFront will accept certificates from
- Click Provision Certificates → Request a public certificate
- Click Request a certificate
- Enter your domain name
- Choose DNS validation
- Click through Next → Review → Confirm and Request
- Click Create a record in Route 53
Validation usually completes within a few minutes.
Wiring the certificate into CloudFront
- Select your distribution → Distribution Settings → Edit
- Alternate Domain Names (CNAMEs): enter your domain (e.g.
saismyhero.com) - SSL Certificate: choose Custom SSL Certificate and select the one you just validated
- Save
From here, https://your_domain.com serves the site directly, and plain HTTP requests redirect to HTTPS automatically.
What you end up with
CloudFront for fast, edge-cached delivery, Route 53 for the domain and DNS, and ACM for the SSL certificate securing the connection — a real website, on your own domain, over HTTPS, for a few dollars a year.
Where to take it next
Add a résumé, blog posts, photography, past projects, and links to GitHub and LinkedIn. And as a bonus project: wire up CI/CD so pushing to your main branch redeploys the site automatically.
Practical guide: if you want to try this yourself
A condensed, copy-pasteable version of the steps above, in order.
- Create a CloudFront distribution. In the CloudFront console, click Create Distribution → Get Started, then set Origin Domain Name to your S3 static-hosting endpoint (
<BucketName>.s3-website.us-east-2.amazonaws.com), leaving the rest default. - Force HTTPS at the edge. Under Default cache behavior, set Viewer Protocol Policy to Redirect HTTP to HTTPS, then save and wait 15-30 minutes for deployment.
- Register your domain in Route 53. Under Registered Domains, click Register Domain, search for the domain, add it to the cart, enter contact details, and complete the order (usually finishes within a couple of hours).
- Point the domain at CloudFront. In the auto-created hosted zone, create an A record, toggle Alias, choose Alias to CloudFront Distribution, and paste in your CloudFront domain name.
- Request a free SSL certificate. In AWS Certificate Manager, switch to us-east-1 / N. Virginia (the only region CloudFront accepts certs from), then Request a public certificate, enter your domain, choose DNS validation, and click Create a record in Route 53 to auto-validate.
- Attach the certificate to your distribution. Go to your distribution's Distribution Settings → Edit, enter your domain under Alternate Domain Names (CNAMEs), and set SSL Certificate to Custom SSL Certificate, selecting the one you just validated.
- Verify the end result.
https://your_domain.comshould now serve the site directly, with plain HTTP requests redirecting to HTTPS automatically.