Route53 & CloudFront
Prerequisites
- Register or transfer a domain with Route53
- Deploy an app with Architect and make note of the
stagingandproductionURLs
Step 1: setup SSL certificates with AWS Certificate Manager
In this step we will request a certificate from Amazon for our domain.
- Open up AWS Certificate Manager in the AWS Console in
us-east-1(region is required!) - Click
Request a certificateand thenRequest a public certificate - Ensure
example.comand*.example.comfor sub domains to work - Choose
DNS validationand clickNext - Add any tags and confirm the request
- Expand the domain and click
Create record in Route53button - Verify CNAME record created in Route53 console Hosted zone
Step 2: setup CloudFront
Generate a CloudFront distribution with the certificate from step 1.
- Sign into AWS CloudFront in the AWS Console
- Click
Create Distributionand then clickGet Started - Enter the URL from API Gateway in
Origin Domain Name - Set
Origin Protocol PolicytoMatch Viewer - Set
Viewer Protocol PolicytoRedirect HTTP to HTTPS - Set
Allowed HTTP MethodstoGET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE - Set
Compress Objects AutomaticallytoYes - Enter the domain alias in
Alternate Domain Names(which you will configure in step 3) - Set
SSL CertificatetoCustom SSL Certificateand select the cert from step 1 - Click
Create Distribution
Step 3: configure the domain Alias in AWS Route53
- Sign into AWS Route53 in the AWS Console
- Navigate to the Hosted zone for the domain
- Click
Create record - Enter the
Record name - Record type is
Aand toggleAliascheckbox on - Select
Alias to CloudFront - Select the region
- Select the CloudFront distribution domain (should be the same value as the domain generated in Step 2)
- Click
Create records
Conclusion
Now we’re done! You can check to see if your domains are online with this DNS Checker tool.