terraform-provider-dns
terraform-provider-dns copied to clipboard
CNAME records fail to update upon parameter change
Terraform Version
Terraform v0.11.8
- provider.dns v2.0.0
Affected Resource(s)
- dns_cname_record
Terraform Configuration Files
provider "dns" {
update {
server = "1.2.3.4"
}
}
resource "dns_cname_record" "pilot-record" {
zone = "myzone.com."
name = "myname"
cname = "internal-lb.amazonaws.com."
ttl = 300
}
Expected Behavior
Terraform should re-create or update the record upon the cname parameter being changed.
Actual Behavior
*dns_cname_record.pilot-record: 1 error(s) occurred: *dns_cname_record.pilot-record: DNS record differs
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
-
terraform apply
- Change the cname parameter in the "dns_cname_record" resource.
- 'terraform apply`
For a workaround, I'm using terraform destroy -target "dns_cname_record.pilot-record"
and then terraform apply
Should the DNS provider be able to re-create or update the CNAME record, or is the actual behavior expected?
Can you build this provider from source against master and try and reproduce? The error message has gone now as part of adding resource import functionality and so I don't think it should error now.
The behaviour should be that it updates the CNAME correctly.
@bodgit Will do. I should get to it next week
I had a further look at the changes I made and I think there is a test that specifically creates a CNAME record then changes its value and checks that it gets updated correctly, which matches your use case. If it does work as I expect then I think you just need to nag somebody at Hashicorp to make a new release of this provider.
Really late reply by me, but I wanted to document that I tested this built with the source and saw the same behavior. However, if I run terraform apply
again, it is successful.