# 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

```terraform
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 generated by tfplugindocs -->
## Schema

### Read-Only

- `domains` (Attributes List) Domains of the instance. (see [below for nested schema](#nestedatt--domains))

<a id="nestedatt--domains"></a>
### 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](#nestedatt--domains--cname_targets))
- `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.

<a id="nestedatt--domains--cname_targets"></a>
### 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`.