From aa22f447586aff5a89fd9d5ccb63811f33eb027b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81oskot?= Date: Thu, 24 Oct 2024 17:56:51 +0200 Subject: [PATCH] feat: Support for cost_analysis_enabled property of azurerm_kubernetes_cluster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The property is available since Terraform provider for Azure v3.106.0 - https://github.com/hashicorp/terraform-provider-azurerm/pull/26052 Signed-off-by: Mateusz Łoskot --- r-aks.tf | 3 ++- variables-aks-light.tf | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/r-aks.tf b/r-aks.tf index b4995ab..7be4392 100644 --- a/r-aks.tf +++ b/r-aks.tf @@ -59,7 +59,8 @@ resource "azurerm_kubernetes_cluster" "aks" { } # Azure integration config - azure_policy_enabled = var.azure_policy_enabled + azure_policy_enabled = var.azure_policy_enabled + cost_analysis_enabled = var.cost_analysis_enabled identity { type = "UserAssigned" diff --git a/variables-aks-light.tf b/variables-aks-light.tf index dd54c19..2a8e0ee 100644 --- a/variables-aks-light.tf +++ b/variables-aks-light.tf @@ -269,6 +269,13 @@ variable "azure_policy_enabled" { default = true } +variable "cost_analysis_enabled" { + description = "Option to enable cost analysis in the Azure portal for this Kubernetes cluster. The `sku_tier` must be set to `Standard` or `Premium` to enable this feature." + type = bool + nullable = false + default = false +} + variable "linux_profile" { description = "Username and SSH public key for accessing Linux nodes with SSH." type = object({