I didn't see any examples of this on the internet so I thought I'd post the solution here.
Asked
Active
Viewed 216 times
1 Answers
2
WARNING: The UltraDNS API will try to "help" you by placing the ending "." on the name. This will cause Terraform to think there are changes every time you plan or apply.
PowerDNS:
locals {
sorted_pdns_hostnames = "${sort(module.server.hostnames)}"
records = "${formatlist("10 10 80 %s.${var.vpc}.${var.region}.private.", local.sorted_pdns_hostnames)}"
}
resource "powerdns_record" "pool" {
zone = "${var.pdns_zone}"
name = "${var.pdns_name}"
type = "SRV"
ttl = 300
records = ["${local.records}"]
}
UltraDNS:
locals {
sorted_hostnames = "${sort(module.server.hostnames)}"
rdata = "${formatlist("10 10 80 %s.${var.vpc}.${var.region}.private.", local.sorted_hostnames)}"
}
resource "ultradns_record" "pool" {
zone = "${var.zone_domain}"
name = "${var.ultradns_record_name}"
rdata = ["${local.rdata}"]
type = "SRV"
ttl = 300
}
![](../../users/profiles/41322.webp)
nowthatsamatt
- 881
- 1
- 8
- 11