terraform-provider-dns
terraform-provider-dns copied to clipboard
dns_a_record_set cannot create A record entries when a matching wildcard CNAME record exist
Terraform Version
-
Terraform v0.11.13
- Tested with DNS provider version 2.2.0
Affected Resource(s)
-
dns_a_record_set
Terraform Configuration Files
# Configure the DNS Provider
provider "dns" {
update {
server = "${local.master_dns_ip}"
key_name = "rndc-key."
key_algorithm = "hmac-md5"
key_secret = "${local.bind_rndc_secret}"
}
}
resource "dns_a_record_set" "ldap_a_record" {
zone = "${local.dns_zone_name}."
name = "ldap"
addresses = ["${module.bootstrap.public_ips}"]
ttl = 300
}
Debug Output
https://gist.github.com/jvshahid/70be63c8a1271873d039472df8132549
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
- Run
terraform apply
to create the A record resource state - Remove the A record out of band, e.g. by recreating the bind server.
- Add a wildcard CName DNS entry in the same bind server, e.g.
*.${local.dns_zone_name}
- Run
terraform apply
Expected Behavior
The last terraform apply
notices the missing A record and creates it.
Actual Behavior
The last step terraform apply
fails with the following error:
Error: Error refreshing state: 1 error(s) occurred:
* dns_a_record_set.ldap_a_record: 1 error(s) occurred:
* dns_a_record_set.ldap_a_record: dns_a_record_set.ldap_a_record: Error querying DNS record: didn't get a A record
Important Factoids
We are using a bind server.
/cc @Logiraptor
Can you capture the DNS traffic as a pcap?
+1 Running into the same issue
+1 me to