Map related functions, most notably merge, will return unknown when the input is not wholly known. In the following example, the keys of of the inputs to merge are all known, and the theoretical result should be sufficient for for_each.
resource "null_resource" "one" {
for_each = { "test1" = 1 }
}
resource "null_resource" "two" {
for_each = { "test2" = 1 }
}
resource "null_resource" "from_both" {
for_each = merge(null_resource.one, null_resource.two)
}
We should be able to relax some of the constraints within the function implementation to return known keys when the input types are equal.
Map related functions, most notably
merge, will returnunknownwhen the input is not wholly known. In the following example, the keys of of the inputs tomergeare all known, and the theoretical result should be sufficient forfor_each.We should be able to relax some of the constraints within the function implementation to return known keys when the input types are equal.