# 

# exoscale_domain_record (Data Source)

Fetch Exoscale [DNS](https://community.exoscale.com/product/networking/dns/) Domain Records data.

Corresponding resource: [exoscale_domain_record]({{< ref "../resources/domain_record.md" >}}).

## Example Usage

```terraform
data "exoscale_domain" "my_domain" {
  name = "my.domain"
}

data "exoscale_domain_record" "my_exoscale_domain_A_records" {
  domain = data.exoscale_domain.my_domain.name
  filter {
    name        = "my-host"
    record_type = "A"
  }
}

data "exoscale_domain_record" "my_exoscale_domain_NS_records" {
  domain = data.exoscale_domain.my_domain.name
  filter {
    content_regex = "ns.*"
  }
}

output "my_exoscale_domain_A_records" {
  value = join("\n", formatlist(
    "%s", data.exoscale_domain_record.my_exoscale_domain_A_records.records.*.name
  ))
}

output "my_exoscale_domain_NS_records" {
  value = join("\n", formatlist(
    "%s", data.exoscale_domain_record.my_exoscale_domain_NS_records.records.*.content
  ))
}
```

Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `domain` (String) The [exoscale_domain]({{< ref "./domain.md" >}}) name to match.
- `filter` (Block List, Min: 1, Max: 1) Filter to apply when looking up domain records. (see [below for nested schema](#nestedblock--filter))

### Read-Only

- `id` (String) The ID of this resource.
- `records` (List of Object) The list of matching records. Structure is documented below. (see [below for nested schema](#nestedatt--records))

<a id="nestedblock--filter"></a>
### Nested Schema for `filter`

Optional:

- `content_regex` (String) A regular expression to match the record content.
- `id` (String) The record ID to match.
- `name` (String) The domain record name to match.
- `record_type` (String) The record type to match.


<a id="nestedatt--records"></a>
### Nested Schema for `records`

Read-Only:

- `content` (String)
- `domain` (String)
- `id` (String)
- `name` (String)
- `prio` (Number)
- `record_type` (String)
- `ttl` (Number)



