Domains
Serve a project on your own domain with HTTPS, with DNS created for you in Route 53 or printed for any provider.
Every project already has its own CloudFront address. A custom domain puts it on a name you own, with HTTPS.
shipzy domain add app.example.com -p my-app # certificate + distribution + DNS (5 to 15 minutes)
shipzy domain ls # hosts, project, stack, certificate and DNS state
shipzy domain verify app.example.com # re-check everything; safe to run any time
shipzy domain rm app.example.com # remove it completely (asks to confirm)
What domain add does#
It can be rerun at any point to continue where it stopped.
- Finds DNS. It looks for a Route 53 hosted zone in your account that covers the hostname.
- Zone found: every DNS record is created for you, and
domain rmremoves the ones it created. - No zone, or
--manual: the exact records are printed and the command waits. Add them wherever your DNS is hosted. There are two: a validation CNAME for the certificate (keep it, since the certificate renews through it) and a CNAME from your hostname to the CloudFront address it prints.
- Zone found: every DNS record is created for you, and
- Requests a free ACM certificate in
us-east-1(CloudFront requires that region). - Creates a small CloudFormation stack with one CloudFront distribution that reuses your main router, routing table and bucket access. Your main distribution is never touched.
- Routes the hostname to the project's live deploy.
Deploys then update all of the project's domains together, and rollback moves them together.
Using a domain from GoDaddy, Namecheap and others#
Pick a subdomain and delegate it to Route 53, so everything is automatic:
- In Route 53, create a hosted zone for the subdomain, for example
apps.example.com. It shows four name servers. - At your registrar, add four
NSrecords namedapps(the subdomain part only) with those four values. - Check it:
dig NS apps.example.com @8.8.8.8. Thenshipzy domain add blog.apps.example.com -p blogjust works.
Your main site on example.com is unaffected.
If you would rather not delegate, use --manual and add the two printed records yourself.
A bare domain (
example.com) cannot be a CNAME, which is what most registrars offer. Use a subdomain such aswww.example.com, or move the domain's DNS to Route 53.
Good to know#
- A hostname can belong to one CloudFront distribution in the world. If it already belongs to another (an old site, for example),
domain addstops and says so. Remove it from that distribution first. - Each domain is one distribution and one certificate. Certificates are free, and an idle distribution costs nothing.
- Route 53 charges about $0.50 a month per hosted zone.
- Enter the Name without your main domain. Providers such as GoDaddy and Namecheap add your domain themselves. For
shipzy.example.com, a record named_abc123.shipzy.example.commust be entered as_abc123.shipzy, and the alias asshipzy. If it is entered in full, the domain is added twice and the certificate never validates.domain addchecks public DNS after a minute and tells you if it finds the record under the doubled name. --no-waitreturns instead of waiting for the certificate and DNS. Rerun the same command later to continue.
Wildcard preview domain#
One wildcard domain serves the previews of every project. See Previews.