Custom-domain TLS verification
After Terraform applies a cloudflare_pages_domain (e.g. docs.nowyourlink.com via PR #65), Cloudflare provisions a managed TLS certificate. The window between “domain attached” and “cert active + serving” is typically 1–10 minutes but can extend. This runbook is the checklist when a custom-domain change does not serve correctly.
Prerequisites. This runbook assumes PR #65 (Cloudflare Pages Terraform) has merged — that PR introduces the
cloudflare_pages_domain.docsresource and thedocs_pages_domain_statusoutput the verify step uses. Before #65 merges, the step-1 command will error withWarning: No outputs found; use the resource fallback below.
Verify
Section titled “Verify”-
Check the Terraform output. From
infra/terraform/:Terminal window terraform output docs_pages_domain_statusExpected:
active. Anything else means cert provisioning has not finished — see status meanings below.Resource fallback (before PR #65 merges)
Section titled “Resource fallback (before PR #65 merges)”If
terraform outputreports no matching output, the named output hasn’t been added yet. Query the resource directly:Terminal window terraform state show 'cloudflare_pages_domain.docs' | grep -E '^\s*status\s*='Same expected value (
active). If the resource itself isn’t in state yet, neither the project nor the domain has been provisioned — re-checkterraform planand the apply log. -
Check the CNAME resolves. From any machine:
Terminal window dig +short docs.nowyourlink.comExpected: a Cloudflare anycast IP (resolves via the proxied apex). If you see
nowyourlink-docs.pages.devinstead of an IP, the apex zone is not proxying — check thecloudflare_dns_record.docsproxied = truesetting. -
Check the cert. From any machine:
Terminal window curl -sI https://docs.nowyourlink.com | head -3echo | openssl s_client -connect docs.nowyourlink.com:443 \-servername docs.nowyourlink.com 2>/dev/null \| openssl x509 -noout -issuer -subject -datesExpected: HTTP 200 + a
lets_encryptorgoogleissuer per thecertificate_authorityset oncloudflare_pages_domain.
Status meanings
Section titled “Status meanings”status value | What it means | What to do |
|---|---|---|
initializing | Domain just attached; CF has not started cert issuance | Wait 2 min; re-check |
pending | Cert issuance in progress | Wait up to 10 min; re-check |
active | Cert issued and serving | Done |
deactivated | Domain manually deactivated in the CF dashboard | Re-activate via Terraform reapply, or in dashboard |
blocked | Cert issuance refused by CF (likely a CAA record or zone-level policy) | See troubleshoot |
error | Issuance failed | Check terraform refresh and verification_data.error_message in the resource state |
Troubleshoot
Section titled “Troubleshoot”If status is blocked or error after 30 minutes:
- CAA records. A
CAArecord on the apex zone that doesn’t authoriseletsencrypt.orgorpki.googwill block issuance. Check withdig CAA nowyourlink.com +short. Either remove the CAA or add an entry for the cert authority. - Validation method.
cloudflare_pages_domain.docs.validation_data.methodreturnshttportxt. Fortxt, ensure a temporaryTXTrecord at_cf-pages-verify.docs.nowyourlink.comexists (CF normally writes it itself when the zone is on the same account — confirm withdig TXT _cf-pages-verify.docs.nowyourlink.com). - Zone mismatch. The custom hostname’s apex zone must be on the same Cloudflare account as the Pages project. Cross-account custom hostnames need extra setup.
proxiedtoggle. Ifcloudflare_dns_record.docs.proxied = falseslipped through, the edge can’t terminate TLS — flip it back totrueand re-apply.
Escalate
Section titled “Escalate”After two terraform refresh/wait cycles (~30 min total) with no active:
- Open a Cloudflare support ticket with: the Pages project name (
nowyourlink-docs), the custom hostname,verification_data.error_message, and the timestamps of the most recentterraform apply. - Notify
#oncall-infraso anyone tracking the rollout knows TLS is the blocker.
See also
Section titled “See also”- Deploy — full path-to-prod context
- Incident response — if the docs site is user-visible-down for > 5 min
- PR #65 — the Pages project + custom-hostname Terraform that triggers this checklist on first apply
- Spec 11 §7 — Docs Site CF Pages deployment