-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
ACM domain_validation_options output not stable #8747
Comments
Realize the terraform 0.12 for_each might actually fix this |
For those looking for a workaround - locals {
zonemap = "${zipmap(aws_route53_zone.hosted-zones.*.name, aws_route53_zone.hosted-zones.*.zone_id)}"
} and then in your R53 record block: resource "aws_route53_record" "domain-validations" {
count = "${length(var.domain_names)}"
zone_id = "${lookup(local.zonemap, "${lookup(aws_acm_certificate.cert.domain_validation_options[count.index], "domain_name")}.")}"
... the rest of the params...
} shoutout to @onyxraven for this solution NOTE: This does seem to force a recreate on each run, but at least it works until there's an upstream solution. |
Possible duplicate of #8531 |
Closing since duplicate of #8531 |
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! |
Community Note
Terraform Version
0.11.11
Affected Resource(s)
aws_acm_certificate
Terraform Configuration Files
Using this module
Debug Output
Panic Output
Expected Behavior
I expect that the domain_validation_options remain stable between terraform runs when there are neither code changes nor aws console changes.
Actual Behavior
The order of items in aws_acm_cert.x.domain_validation_options seems to be unstable. If we are creating other resources using a
count
on this list (example) then we get spurious diffs.first run:
second run:
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: