Terraform v0.11.10
resource "aws_route53_record" "big_happy_alias_record" {
zone_id = "${var.zone_id}"
name = "${var.name}"
type = "${var.type}"
alias {
name = "${var.alias_name}"
zone_id = "${var.alias_zone_id}"
evaluate_target_health = "${var.alias_evaluate_target_health}"
}
allow_overwrite = "${var.allow_overwrite}"
}
I imported an existing DNS record into terraform, which was an ALIAS record that contained a "dualstack" prefix in its alias target. I then ran a trivial apply operation on the resource to change the "allow_overwrite" value to false. This should not have silently changed the ALIAS target in the record.
The initial import worked fine, but when I run any apply whatsoever on the resource it ends up silently stripping off the "dualstack" prefix without saying anything in the plan.
terraform apply
with any changes after importing an ALIAS record whose target has a dualstack prefixI think I narrowed down why this is happening. I inspected the debug output and found that the prefix did indeed seem to be stripped off halfway through the apply operation, so I checked the provider code and found this function. I haven't read this in any detail but it appears this would cause any ALIAS record in terraform to have its dualstack prefix stripped off 100% of the time. Can anyone provide any insight into why this would be the desired/appropriate behavior? We actually do want many of our ALIAS records to use dualstack, so this pretty much means the route 53 resources are largely not useful at all in our case.
So it's just impossible to have a dualstack alias record if you use terraform???
A perpetual changed loop was "fixed" by just forcing all alias records to non dualstack!
:man_facepalming:
I'm having a related issue with terraform 0.12.12 / aws provider 2.33. If I create an alias record and then add/remove the dualstack prefix in the terraform configuration, Terraform detects no changes to apply so the record does not get updated.
Any news about it????????