diff --git a/main.tf b/main.tf index 499a8b30..55289f5f 100644 --- a/main.tf +++ b/main.tf @@ -501,7 +501,7 @@ resource "azurerm_kubernetes_cluster" "main" { } } dynamic "oms_agent" { - for_each = var.log_analytics_workspace_enabled ? ["oms_agent"] : [] + for_each = (var.log_analytics_workspace_enabled && var.oms_agent_enabled) ? ["oms_agent"] : [] content { log_analytics_workspace_id = local.log_analytics_workspace.id diff --git a/variables.tf b/variables.tf index 343d1eba..84bc5a37 100644 --- a/variables.tf +++ b/variables.tf @@ -374,6 +374,12 @@ variable "azure_policy_enabled" { description = "Enable Azure Policy Addon." } +variable "oms_agent_enabled" { + type = bool + default = false + description = "Enable OMS Agent Addon." +} + variable "brown_field_application_gateway_for_ingress" { type = object({ id = string