wihan/dev

docs /clerk / data sources

markdown
browse the clerk docs

clerk_domains (Data Source)

All domains of the instance, with the CNAME records that a production instance needs in DNS. Feed cname_targets into your DNS provider to keep the Clerk records in code.

Example Usage

data "clerk_domains" "all" {}

# The CNAME records that the primary domain needs in DNS, keyed by host.
# Feed this map into your DNS provider (for example Cloudflare) to keep the
# Clerk records in code.
locals {
  primary_domain = one([
    for d in data.clerk_domains.all.domains : d if !d.is_satellite
  ])

  clerk_dns = {
    for t in local.primary_domain.cname_targets : t.host => t.value
  }
}

Schema

Read-Only

Nested Schema for domains

Read-Only:

  • accounts_portal_url (String) Account Portal URL. Null for a satellite domain.
  • cname_targets (Attributes List) CNAME records that this domain needs in DNS. Empty for a development instance. (see below for nested schema)
  • development_origin (String) Origin of the development instance.
  • frontend_api_url (String) Frontend API URL for this domain.
  • id (String) Domain id.
  • is_satellite (Boolean) true for a satellite domain.
  • name (String) Domain name, for example example.com.
  • proxy_url (String) Proxy URL. Null when the domain does not use a proxy.

Nested Schema for domains.cname_targets

Read-Only:

  • host (String) Record host, for example clerk.example.com.
  • value (String) Record target, for example frontend-api.clerk.services.