This is an update to the blog article Redirecting a domain with HTTPS using Amazon S3 and CloudFront — Simone Carletti, all of the screen have been updated, so follow that article, while referencing this one.
Create a S3 bucket
- Create a new bucket in AWS S3
- Name the bucket the origin website
- Accept the defaults
- Open the bucket’s properties
- Enable Static website hosting
- Redirect request
- Destination website without protocol
- HTTPS for the protocol
Request the SSL Certificate
- In Certificate Manager, Request a certificate
- Origin domain + www.origindomain
- Save the certificate
- Add the DNS validation in Route53 (from Certificate Manager)
- Wait for the validation to complete
Configure CloudFront HTTPS
- Create distribution
- Choose origin domain from s3
- Select use s3 website
- Do not enable security protections
- Alternate domain name
- Both with and without www origin domain
- Custom SSL certificate, the one that we created earlier
- Enable HTTP/3
Set up the Route53 Domain
- Create a new apex A record for the domain
- Select ALIAS
- Select CloudFront Distribution and then the distribution
At this point, your origin apex domain as well as the www subdomain should forward to the site specified in the s3 bucket.