Skip to content

Map functions should be able to return known keys #24024

@jbardin

Description

@jbardin

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions