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

akamai_dns_record: targets ending with "." stripped, causing constant apply churn #189

Closed
dekimsey opened this issue Nov 11, 2020 · 1 comment

Comments

@dekimsey
Copy link

dekimsey commented Nov 11, 2020

Terraform Version

terraform -v
Terraform v0.13.5
+ provider registry.terraform.io/akamai/akamai v0.10.2
+ provider registry.terraform.io/hashicorp/aws v3.12.0

Affected Resource(s)

Please list the resources as a list, for example:

  • akamai_dns_record
  • aws_route53_zone

Terraform Configuration Files

# Our external zone for management and entry to the VPC.
resource "aws_route53_zone" "external" {
  name          = "example.company.cloud"
  comment       = "Externally-facing, managed entirely by Terraform"
  force_destroy = true

  tags = module.label.tags
}

resource "akamai_dns_record" "external-ns" {
  recordtype = "NS"
  zone       = "company.cloud"
  name       = "external.company.cloud"
  active     = true
  ttl        = 600
  target     = aws_route53_zone.external.name_servers
}

Debug Output

not applicable

Panic Output

not applicable

Expected Behavior

Second apply should be a NOOP.

Actual Behavior

The second apply seems to want to update the record because of akamai appends a "." suffix to the records. I don't know enough about DNS spec to say if this is an issue with AWS or Akamai's provider, but from practicality standpoint, it doesn't really matter and it maybe it shouldn't be considered a diff change.

Terraform will perform the following actions:

  # akamai_dns_record.external-ns will be updated in-place
  ~ resource "akamai_dns_record" "external-ns" {
        active     = true
        id         = "company.cloud#example.company.cloud#NS"
        name       = "example.company.cloud"
        record_sha = "008f77b70dc848f42efec421385b68a2cf6c1d06"
        recordtype = "NS"
      ~ target     = [
          - "ns-1501.awsdns-59.org.",
          - "ns-1632.awsdns-12.co.uk.",
          - "ns-312.awsdns-39.com.",
          - "ns-882.awsdns-46.net.",
          + "ns-1501.awsdns-59.org",
          + "ns-1632.awsdns-12.co.uk",
          + "ns-312.awsdns-39.com",
          + "ns-882.awsdns-46.net",
        ]
        ttl        = 600
        zone       = "company.cloud"
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. terraform apply # should be a noop

Important Factoids

The AWS aws_route53_record resource receives the same inputs and doesn't cause churn.

# Put our NS records in the external domain
resource "aws_route53_record" "external-ns" {
  zone_id         = aws_route53_zone.external.zone_id
  name            = "example.company.com"
  type            = "NS"
  ttl             = "30"
  allow_overwrite = "true"
  records = aws_route53_zone.external.name_servers
}

References

None

@lkowalsk-akamai-com
Copy link
Contributor

Hi @dekimsey, we believe that issue is fixed with latest version of Akamai Terraform Provider. Please check and close the issue if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants