drift Docs
Pages
drift Docs
Start
What is Drift?
The tour, if you are new here.
Use cases
Whether Drift does your thing.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, four unit prices, two rules.
Moving off Azure
Estimate, snapshot and transform a resource group.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Route gates, API keys and your account.
Teams
More than one person on one account.
Security
Boundaries, sandboxing and hardening.
Troubleshooting
Error codes
What went wrong, and what to do about it.
Legal
Acceptable use
What a slice may not be used for.
Data processing
The DPA, and every sub-processor.

Domains: custom hostnames

A domain block inside edge is a hostname the slice answers on, beyond its default <user>-<slice>.ondrift.eu. It is labelled with the hostname, and it sits with the rest of what reaches the slice.

Driftfile
edge {
  domain "forms.gemeente.example" {}

  domain "tenants.example.org" {
    wildcard = true
  }
}
TypeDefaultMeaning
  • domain "host"
    Type
    label
    Default
    REQUIRED
    Meaning
    The hostname the slice should answer on. Compared in lower case.
  • wildcard
    Type
    bool
    Default
    false
    Meaning
    Route every subdomain of the host to this slice too.

A domain is yours only once you have proved it. Declaring it attaches it to the slice; it does not route until a DNS TXT record proves you control the name. Point your DNS at the slice, publish the record, then run:

drift slice domain verify forms.gemeente.example

verify re-checks the TXT record and, on success, issues the TLS certificate. Run it again if the record has not propagated yet. drift slice domain list shows each hostname and its status, and drift slice domain remove <host> takes one away, along with its certificate and routing.

The deploy adds what is missing: a host declared here and not yet on the slice is attached. A host live on the slice and absent here stays attached, and the apply names it in its closing report, so it is never removed behind your back. Two projects can share a slice, and a deploy cannot tell a host that is not yours from one you dropped. Take one away deliberately with drift slice domain remove <host>. drift plan lists each domain as domain forms.gemeente.example, with + when the apply would attach it. Domain reconcile is best-effort: a failure is reported but does not abort the rest of the deploy. A free slice grants no custom domains, so a file that declares one is priced, and drift plan says that the domain is what took it out of the free slice.

A verified domain can also be handed to another slice of yours: edge.hosts fronts a linked slice on a hostname this slice owns. Hostnames and domains covers the commands, verification and fronting end to end.

Two things wildcard does not mean.

It is routing, not certificates: each subdomain still gets its own certificate, issued on demand, and there is no wildcard cert. And it is not multitenancy: telling alice.example.org from bob.example.org is your app's job. The apply attaches a new host with the wildcard its block declares. A host already on the slice keeps the setting it was attached with: the apply does not change it, so a host that should change is removed with drift slice domain remove <host> and attached again.