Terraform-provider-aws: Dualstack prefix forcibly removed from ALIAS records

Created on 15 Nov 2018  路  4Comments  路  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.10

  • provider.aws v1.44.0
  • provider.terraform v1.0.2

Affected Resource(s)

  • aws_route53_record

Terraform Configuration Files

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}"
}

Expected Behavior

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.

Actual Behavior

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.

Steps to Reproduce

  1. terraform apply with any changes after importing an ALIAS record whose target has a dualstack prefix

Important Factoids

I 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.

References

bug servicroute53

All 4 comments

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:

https://github.com/terraform-providers/terraform-provider-aws/commit/95ce334fa0ece2a0625e08d8055725a23e6b072f

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????????

Was this page helpful?
0 / 5 - 0 ratings