diff --git a/main.tf b/main.tf index 03777782..59d4c221 100644 --- a/main.tf +++ b/main.tf @@ -67,7 +67,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "this" { # if the region does not have zone create a single node pool with the zone as null # if node pools are not emplty check if the node has a zone if yes then create a node pool per zone otherwise create a single node pool # count = var.node_pools != null ? var.zones ? 3 : 1 : length(local.zones) - count = var.node_pools != null ? (var.zones != null ? length(var.node_pools) * 3 : length(var.node_pools)) : length(var.zones) + count = var.node_pools != null ? (var.zones != null ? length(var.node_pools) * 3 : length(var.node_pools)) : 0 kubernetes_cluster_id = azurerm_kubernetes_cluster.this.id name = "workload${count.index + 1}" diff --git a/variables.tf b/variables.tf index 7b936d07..b0ab198f 100644 --- a/variables.tf +++ b/variables.tf @@ -107,7 +107,7 @@ variable "node_pools" { mode = optional(string) os_disk_size_gb = optional(number, null) tags = optional(map(string), {}) - zones = optional(string) + zones = optional(set(string)) })) default = [{ name = "workload"