cloudflare/dns-record
A thin wrapper around a single `cloudflare_dns_record`. It adds no behaviour: every argument is passed through as given, and an optional argument left `null` stays unset rather than picking up a default here. It exists so that a leaf managing DNS records calls a pigeon-lib module, like every other leaf (LIB-0004). It's **zone-scoped**: a leaf calling it lives at `terraform/cloudflare/<zone>/dns-record/<instance>/`, where `<zone>` is the zone's apex domain. `terragrunt/root-hcl` v2.2.0 then gives the leaf `local.cloudflare_zone_id` for that zone (LIB-0008).
Usage
locals {
records = {
mx_primary = {
name = "@"
type = "MX"
content = "in1-smtp.example.com"
priority = 10
comment = "primary mx"
}
www_cname = {
name = "www"
type = "CNAME"
content = "example.github.io"
proxied = false
}
}
}
module "dns_record" {
source = "https://pigeon.dev/modules/cloudflare/dns-record/v0.1.0"
for_each = local.records
zone_id = local.cloudflare_zone_id
name = each.value.name
type = each.value.type
content = each.value.content
ttl = try(each.value.ttl, 1)
proxied = try(each.value.proxied, null)
priority = try(each.value.priority, null)
comment = try(each.value.comment, null)
}
Full inputs/outputs documentation is in the module's README on GitHub.