docs: update provider docs for full CRUD support

This commit is contained in:
beatz174-bit
2026-05-04 01:02:36 +10:00
parent ba71837a59
commit 2c671aaa0f
5 changed files with 253 additions and 365 deletions
+104
View File
@@ -0,0 +1,104 @@
# dynu_dns_record Resource
Manages a Dynu DNS record under the Dynu root domain resolved from `hostname`.
## Example Usage
### A record
```terraform
resource "dynu_dns_record" "a" {
hostname = "www.example.com"
record_type = "A"
content = "198.51.100.20"
ttl = 300
}
```
### CNAME record
```terraform
resource "dynu_dns_record" "cname" {
hostname = "app.example.com"
record_type = "CNAME"
content = "target.example.net"
}
```
### MX record
```terraform
resource "dynu_dns_record" "mx" {
hostname = "example.com"
record_type = "MX"
content = "mail.example.com"
priority = 10
}
```
### TXT record
```terraform
resource "dynu_dns_record" "txt" {
hostname = "example.com"
record_type = "TXT"
content = "v=spf1 include:_spf.example.com ~all"
}
```
### SRV record
```terraform
resource "dynu_dns_record" "srv" {
hostname = "_sip._tcp.example.com"
record_type = "SRV"
content = "sip.example.com"
priority = 10
weight = 5
port = 5060
}
```
## Schema
### Required
- `hostname` (String) Fully-qualified hostname.
- `record_type` (String) DNS record type.
### Optional + Computed
- `content` (String)
- `dynamic` (Boolean)
- `ttl` (Number)
- `enabled` (Boolean, defaults to `true`)
- `group` (String)
- `host` (String)
- `priority` (Number)
- `weight` (Number)
- `port` (Number)
- `flags` (Number)
- `tag` (String)
- `value` (String)
- `node_name` (String)
Type-specific notes:
- `A`/`AAAA` support dynamic semantics using omitted `content` or explicit `dynamic = true`.
- `MX` and `SRV` use `priority`.
- `SRV` also uses `weight` and `port`.
- `CAA` uses `flags`, `tag`, and `value`.
### Computed
- `id` (String) Composite ID in `domain_id/record_id` format.
- `domain_id` (Number)
- `domain_name` (String)
- `updated_on` (String)
## Import
Import using `domain_id/record_id`:
```bash
terraform import dynu_dns_record.example 1234/5678
```
+24 -42
View File
@@ -1,6 +1,6 @@
# dynu_domain Resource
Manages a Dynu DNS domain.
Manages a Dynu DNS root domain.
## Example Usage
@@ -18,6 +18,27 @@ resource "dynu_dns_record" "www" {
}
```
## Schema
### Required
- `name` (String) Root domain name. Changing this forces replacement.
### Optional + Computed
- `ipv4_address` (String)
- `ipv6_address` (String)
- `ttl` (Number)
- `group` (String)
These fields can be configured, and also reflect values returned by Dynu.
### Computed
- `id` (Number) Dynu numeric domain ID.
- `state` (String) Dynu state.
- `token` (String, Sensitive) Dynu domain token.
## Import
Import using the numeric Dynu domain ID:
@@ -26,45 +47,6 @@ Import using the numeric Dynu domain ID:
terraform import dynu_domain.example 1234
```
## Attributes
## Warning
- `id` (Number) Dynu domain ID.
- `name` (String) Domain name (forces replacement when changed).
- `ipv4_address` (String) Optional IPv4 address.
- `ipv6_address` (String) Optional IPv6 address.
- `ttl` (Number) Optional TTL.
- `group` (String) Optional group.
- `state` (String) Computed state from Dynu API.
- `token` (String, Sensitive) Computed domain token from Dynu API.
## DNS record examples under this domain
```terraform
resource "dynu_dns_record" "mx" {
hostname = dynu_domain.example.name
record_type = "MX"
content = "mail.my-test-domain.example"
priority = 10
}
resource "dynu_dns_record" "txt_spf" {
hostname = dynu_domain.example.name
record_type = "TXT"
content = "v=spf1 include:_spf.example.com ~all"
}
resource "dynu_dns_record" "cname" {
hostname = "app.${dynu_domain.example.name}"
record_type = "CNAME"
content = "target.example.net"
}
resource "dynu_dns_record" "srv" {
hostname = "_sip._tcp.${dynu_domain.example.name}"
record_type = "SRV"
content = "sip.my-test-domain.example"
priority = 10
weight = 5
port = 5060
}
```
Deleting this resource deletes the entire Dynu DNS zone for that domain.