Prerequisites
Create and validate certificate for your CloudFront distribution.
AWS CloudFront
Navigate to CloudFront > Create Distribution > Web > Get Started
Create Distribution | |
Origin Domain Name |
List of available origins including S3 Buckets and Elastic Load Balancers. Select your S3 Bucket. |
Origin ID | G53_CFD_S3-gateway53.com |
Restrict Bucket Access | No |
Default Cache Behavior Settings | |
Distribution Settings | |
Price Class | Use All Edge Locations |
Alternate Domain Names (CNAMEs) |
Make sure to set one or more Alternate Domain Names, otherwise it won't be listed on the target combo for Route53 Alias. The name of your Amazon Route 53 hosted zone (such as example.com) must match an alternate domain name in the CloudFront distribution. |
SSL Certificate | Click on 'Custom SSL Certificate (example.com)' and select your certificate from the provided list. |
Default Root Object | index.html or whatever your root object name is |
Click on 'Create Distribution'.
It can take some time to create your distribution.
Create Behavior Settings
Navigate to CloudFront > select your distribution by clicking on the ID.
Click on the 'Behaviors' tab.
Select the existing Behavior with Path Pattern: Default(*) and click 'Edit'.
Create Behavior Settings | |
Viewer Protocol Policy | Redirect HTTP to HTTPS |
Click 'Yes, Edit'