Skip to main content

okustera_dns_recordset (Resource)

The okustera_dns_recordset resource manages DNS recordsets (A, AAAA, CNAME, MX, TXT, SRV, PTR, NS, CAA) within an okustera_dns_zone in Okustera.

Example Usage​

Standard A & CNAME Recordsets​

resource "okustera_dns_zone" "main" {
name = "example.com."
ttl = 300
}

resource "okustera_dns_recordset" "apex_a" {
zone_id = okustera_dns_zone.main.id
name = "example.com."
type = "A"
ttl = 300
records = ["198.51.100.10", "198.51.100.11"]
description = "Primary web ingress endpoints"
}

resource "okustera_dns_recordset" "www_cname" {
zone_id = okustera_dns_zone.main.id
name = "www.example.com."
type = "CNAME"
ttl = 300
records = ["example.com."]
description = "WWW alias"
}

Binding to an Octavia Load Balancer VIP​

resource "okustera_dns_recordset" "lb_vip" {
zone_id = okustera_dns_zone.main.id
name = "api.example.com."
type = "A"
ttl = 60
records = [okustera_loadbalancer.api_lb.vip_address]
target_lb_id = okustera_loadbalancer.api_lb.id
description = "Bound to Octavia Load Balancer VIP"
}

Schema​

Required​

  • zone_id (String) UUID of the parent okustera_dns_zone. Changing this forces a new resource to be created.
  • name (String) Record name (relative subdomain such as app, @ for zone apex, or fully-qualified domain name app.example.com.). Changing this forces a new resource to be created.
  • type (String) DNS recordset type (A, AAAA, CNAME, MX, TXT, SRV, PTR, NS, CAA). Changing this forces a new resource to be created.
  • records (List of String) List of record values (e.g., IPv4 addresses for A, target FQDNs for CNAME/PTR, priority + mail host for MX).

Optional​

  • ttl (Number) Time-To-Live in seconds (60–86400, defaults to 300).
  • description (String) Optional human-readable description.
  • target_lb_id (String) Optional Octavia Load Balancer UUID when binding the recordset to a Load Balancer VIP.

Read-Only Attributes​

  • id (String) Unique UUID of the recordset.
  • zone_name (String) Canonical FQDN of the parent DNS zone.
  • status (String) Provisioning status of the recordset (ACTIVE).

Import​

Existing DNS recordsets can be imported using <zone_uuid>/<recordset_uuid>:

terraform import okustera_dns_recordset.apex_a <zone_uuid>/<recordset_uuid>