Skip to content

Commit ae780eb

Browse files
authored
Explicitely type tag map variables in oke submodule (#709)
When trying to update defined_tags on a cluster, via the configuration: ``` defined_tags = { oke = { cluster = { "NEW_KEY" = "NEW_TAG" } persistent_volume = { "NEW_KEY" = "NEW_TAG" } service_lb = { "NEW_KEY" = "NEW_TAG" } node_pool = { "NEW_KEY" = "NEW_TAG" } node = { "NEW_KEY" = "NEW_TAG" } } } ``` one gets these errors for the cluster, persistent_volume, service_lb parts: ``` defined_tags = lookup(var.defined_tags, "<PART>", {}) Invalid value for "default" parameter: the default value must have the same type as the map elements. ``` this is because terrafrom cannot reconciliate the map string->string type of the tags submaps with the type of the empty map. Fix this as outlined in hashicorp/terraform#27509 by explicitely typing the submap variables. node_pool and node do not suffer the same issue, as I assume the merge function does cleverer overload resolution, but more precision doesn't hurt. Signed-off-by: Andrea Stacchiotti <[email protected]>
1 parent 0a95fce commit ae780eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/oke/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ variable "worker_nsgs" {
133133
}
134134

135135
variable "freeform_tags" {
136-
type = map(any)
136+
type = map(map(string))
137137
}
138138

139139
variable "defined_tags" {
140-
type = map(any)
140+
type = map(map(string))
141141
}

0 commit comments

Comments
 (0)