Skip to content

Instantly share code, notes, and snippets.

@badri
Created February 25, 2023 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badri/9c23b60d80b84386b0e5a234fa4796d7 to your computer and use it in GitHub Desktop.
Save badri/9c23b60d80b84386b0e5a234fa4796d7 to your computer and use it in GitHub Desktop.
YAML config based node pools
locals {
node_pools = yamldecode(file("${path.module}/node-pool.yaml"))
}
resource "azurerm_kubernetes_cluster_node_pool" "aks_node_pool" {
count = length(local.node_pools)
name = local.node_pools[count.index].name
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id
vm_size = local.node_pools[count.index].vm_size
node_count = local.node_pools[count.index].node_count
tags = merge(local.node_pools[count.index].tags...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment