# 

# exoscale_domain_record (Resource)

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

Corresponding data source: [exoscale_domain_record]({{< ref "../data-sources/domain_record.md" >}}).

## Example Usage

```terraform
resource "exoscale_domain" "my_domain" {
  name = "example.net"
}

resource "exoscale_domain_record" "my_host" {
  domain      = exoscale_domain.my_domain.id
  name        = "my-host"
  record_type = "A"
  content     = "1.2.3.4"
}

resource "exoscale_domain_record" "my_host_alias" {
  domain      = exoscale_domain.my_domain.id
  name        = "my-host-alias"
  record_type = "CNAME"
  content     = exoscale_domain_record.my_host.hostname
}
```

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

- `content` (String) The record value. Format follows specific record type. For example SRV record format would be `<weight> <port> <target>`
- `domain` (String) ❗ The parent [exoscale_domain]({{< ref "./domain.md" >}}) to attach the record to.
- `name` (String) The record name, Leave blank (`""`) to create a root record (similar to using `@` in a DNS zone file).
- `record_type` (String) ❗ The record type (`A`, `AAAA`, `ALIAS`, `CAA`, `CNAME`, `HINFO`, `MX`, `NAPTR`, `NS`, `POOL`, `SPF`, `SRV`, `SSHFP`, `TXT`, `URL`).

### Optional

- `prio` (Number) The record priority (for types that support it; minimum `0`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `ttl` (Number) The record TTL (seconds; minimum `0`; default: `3600`).

### Read-Only

- `content_normalized` (String) The normalized value of the record
- `hostname` (String) The record *Fully Qualified Domain Name* (FQDN). Useful for aliasing `A`/`AAAA` records with `CNAME`.
- `id` (String) The ID of this resource.

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

Optional:

- `create` (String)
- `delete` (String)
- `read` (String)
- `update` (String)

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.

## Import

```shell
# An existing DNS domain record may be imported by `<ID>`:

terraform import \
  exoscale_domain_record.my_host \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6
```

