Skip to content

Commit cc910e6

Browse files
authored
Merge pull request #15 from clouddrove/fix/identos_211
fix: Updated loadbalancer diagnostic setting
2 parents 3029d99 + f65ecda commit cc910e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,9 @@ data "azurerm_resources" "aks_lb" {
485485

486486
resource "azurerm_monitor_diagnostic_setting" "aks-lb" {
487487
depends_on = [data.azurerm_resources.aks_lb, azurerm_kubernetes_cluster.aks]
488-
count = var.enabled && var.diagnostic_setting_enable && var.private_cluster_enabled == true ? 1 : 0
489-
name = format("%s-kubernetes-load-balancer-diagnostic-log", module.labels.id)
490-
target_resource_id = join("", data.azurerm_resources.aks_lb[count.index].resources.*.id)
488+
count = var.enabled && var.diagnostic_setting_enable && var.private_cluster_enabled == true ? length(data.azurerm_resources.aks_lb[0].resources) : 0
489+
name = format("%s-kubernetes-load-balancer-diagnostic-log-%d", module.labels.id, count.index)
490+
target_resource_id = data.azurerm_resources.aks_lb[0].resources[count.index].id
491491
storage_account_id = var.storage_account_id
492492
eventhub_name = var.eventhub_name
493493
eventhub_authorization_rule_id = var.eventhub_authorization_rule_id

0 commit comments

Comments
 (0)