Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_elb resources export a DNS name that makes route53 change every apply #1865

Closed
sysadmin1139 opened this issue Oct 11, 2017 · 4 comments
Closed
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.

Comments

@sysadmin1139
Copy link

After investigation through #241 I've discovered where some of our continual applies come from.

This is with version 1.0 of the provider, though we've been seeing it as far back as Terraform 8.

  ~ aws_route53_record.ex-web-b
      alias.1871597309.evaluate_target_health:    "" => "true"
      alias.1871597309.name:                      "" => "lb-prod-web-ex-[redacted1].us-east-1.elb.amazonaws.com"
      alias.1871597309.zone_id:                   "" => "[redacted2]"
      alias.759637084.evaluate_target_health:     "true" => "false"
      alias.759637084.name:                       "lb-prod-web-ex-[redacted1].us-east-1.elb.amazonaws.com." => ""
      alias.759637084.zone_id:                    "[redacted3]" => ""

The from part of the diff has a trailing dot it, but the to part does not. Also, the zone-ids are different. This record is created from a resource like:

  alias {
    name = "${aws_elb.prod-web-ex.dns_name}"
    zone_id = "${aws_elb.prod-web-ex.zone_id}"
    evaluate_target_health = true
  }

This makes it seem like the elb resource is exporting a dns_name and zone_id that is always different than the data found in a Route53 record.

We've noticed that aws_alb resources don't do this for some reason.

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Oct 15, 2017
@bflad bflad added the service/route53 Issues and PRs that pertain to the route53 service. label Jan 19, 2018
@bflad
Copy link
Contributor

bflad commented Feb 11, 2018

@sysadmin1139 is this an issue still in recent versions of the AWS provider?

For the trailing dot issue, we can probably augment the DiffSuppressFunc for the alias name (added in #3119) to also allow it to suppress if both entries with strings.TrimSuffix() match.

As for the zone ID issue, does using the ELB hosted zone ID available via the aws_elb_hosted_zone_id data source) work better?

@PatrikStenmark
Copy link

PatrikStenmark commented Mar 27, 2018

I also had this problem when running version 1.12.0 of the AWS provider after upgrading från 0.1. Using the data source as you suggest works for me.

Thanks!

@sysadmin1139
Copy link
Author

@bflad Just checked, that using that particular data source definitely works better. These diffs are so much cleaner now. With provider version 1.13.0 in, we're not getting the originally reported behavior either. So this looks fixed!

@ghost
Copy link

ghost commented Apr 7, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.
Projects
None yet
Development

No branches or pull requests

4 participants