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_route53_record NS records do not work with lists of zones #19338

Closed
querry43 opened this issue Nov 9, 2018 · 2 comments
Closed

aws_route53_record NS records do not work with lists of zones #19338

querry43 opened this issue Nov 9, 2018 · 2 comments
Milestone

Comments

@querry43
Copy link

querry43 commented Nov 9, 2018

Terraform Version

Terraform v0.11.10
+ provider.aws v1.38.0

Terraform Configuration Files

variable "zones" {
  type    = "list"
  default = ["foo", "bar"]
}

resource "aws_route53_zone" "zones" {
  count = "${length(var.zones)}"
  name  = "${var.zones[count.index]}"
}

resource "aws_route53_record" "ns_records" {
  count   = "${length(var.zones)}"
  zone_id = "${aws_route53_zone.zones.*.zone_id[count.index]}"
  name    = ""
  type    = "NS"
  ttl     = "900"

  records = [
    "${aws_route53_zone.zones.*.name_servers.0[count.index]}"
  ]
}

Debug Output

https://gist.github.com/querry43/49af5f33a9139709ba4b23a8ca108145

Crash Output

Expected Behavior

aws_route53_zone.zones.*.name_servers.0 should be a value which is collected after creating the zone.

Actual Behavior

TF is unable to determine the value for the nameservers. This works is the nameservers are commented out and then added after the zone already exists. Adding depends_on does not change this behavior.

Steps to Reproduce

terraform init
terraform apply

Additional Context

This works is the zone records already exist. Our current workaround is to comment out the ns records to create the zone, then uncomment and add the records in the second pass.

References

@apparentlymart
Copy link
Contributor

Hi @querry43! Sorry for this broken behavior, and thanks for reporting it.

This seems to be the same root problem as #17156, which I've confirmed is already fixed in the master branch. See my comment on the other issue for details on how I confirmed that. The fix will be included in the forthcoming v0.12.0 release.

Since there's already a fix in master, I'm going to close this out. Thanks again for reporting this!

@ghost
Copy link

ghost commented Mar 31, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants