Terraform v0.12.6
+ provider.null v2.1.2
variable "test" {
default = {
foo = "bar"
}
}
resource "null_resource" "test" {
for_each = var.test
triggers = {
foo = each.key
}
provisioner "local-exec" {
command = "echo ${each.value}"
}
}
https://gist.github.com/adarobin/5c7a6449bd6c2a0ace6550f9f64219a7
https://gist.github.com/adarobin/16994b75a44f3bd8eff8efa9287d4d22
The apply was successful.
Terraform crashed
terraform initterraform apply
Interestingly, this works and does not crash
variable "test" {
default = {
foo = "bar"
}
}
resource "null_resource" "test" {
for_each = var.test
triggers = {
foo = each.key
}
provisioner "local-exec" {
command = "echo ${var.test[each.key]}"
}
}
@adarobin Thank you for this report! I believe it's a duplicate of https://github.com/hashicorp/terraform/issues/22289, and there's a fix in master that will go out in the next release of Terraform (0.12.7), and I'll leave this open until that's out to help future reporters. Thank you!
Same problem here.
The same problem...
Terraform 0.12.7 (with this fix) is now released! https://github.com/hashicorp/terraform/blob/v0.12.7/CHANGELOG.md
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.
Most helpful comment
@adarobin Thank you for this report! I believe it's a duplicate of https://github.com/hashicorp/terraform/issues/22289, and there's a fix in master that will go out in the next release of Terraform (0.12.7), and I'll leave this open until that's out to help future reporters. Thank you!