Dreamhost
Prerequisites
- Sign up for a domain on Dreamhost
- Make sure your domain is set to
DNS Only
in the Dreamhost console. - Deploy an app with Architect and make note of the
staging
andproduction
URLs - Make sure your app is deployed to
us-east-1
- Ensure the
@app
name is uniquely named after the domain.
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 certificate
and thenRequest a public certificate
- Ensure
example.com
and*.example.com
for sub domains to work - Choose
DNS validation
and clickNext
- Add any tags and confirm the request
- Open up Dreamhost backend and click
Manage Domains
- Click the
DNS
link under your domain to add custom DNS records - Create CNAME records of both issued certificates
- Wait until they change from
pending
tosuccess
Step 2: setup CloudFront
Generate a CloudFront distribution with the certificate from step 1.
- Sign into AWS CloudFront in the AWS Console
- Click
Create Distribution
and then clickGet Started
- Open API Gateway and make note of the Invoke URL.
- Enter the URL from API Gateway in
Origin Domain Name
- Set
Origin Protocol Policy
toMatch Viewer
- Add the
Alternate Domain Names (CNAMEs)
that you will be using. ex.example.com
. - Set
Viewer Protocol Policy
toRedirect HTTP to HTTPS
- Set
Allowed HTTP Methods
toGET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
- Set
Compress Objects Automatically
toYes
- Set
SSL Certificate
toCustom SSL Certificate
and select the cert from step 1 - Click
Create Distribution
- Repeat for
staging
domain.
Step 3: configure the domain Alias in Dreamhost
Add Alias
and CNAME
records to DNS.
- Sign into Dreamhost
- Navigate to the domain by clicking
Manage Domains
in the sidebar. - Click
DNS
under the domain - Click
Add Record
- Use record type
Alias
for the root domain.- Leave
Host
input blank and add the CloudFront domain that was created in step 2 to thePoints to
input.
- Leave
- Use record type
CNAME
for thestaging
domain.- Add the word
staging
to theHost
input and add the CloudFront domain that was created in step 2 to thePoints to
input.
- Add the word
- Click
Add records
Conclusion
Now we’re done! You can check to see if your domains are online with the DNS checker tool provided by Dreamhost. You can also use this DNS Checker tool.