Skip to content

Commit

Permalink
fix: invalid count argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Telemaco019 committed Aug 12, 2024
1 parent a2a8ae9 commit b6276d3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,11 @@ resource "azurerm_key_vault" "main" {
tags = var.tags
}
resource "azurerm_role_assignment" "key_vault_secret_user__aks" {
count = length(module.aks.key_vault_secrets_provider.secret_identity) > 0 ? 1 : 0

scope = azurerm_key_vault.main.id
principal_id = module.aks.key_vault_secrets_provider.secret_identity[0].object_id
scope = azurerm_key_vault.main.id
principal_id = try(
module.aks.key_vault_secrets_provider.secret_identity[0].object_id,
module.aks.cluster_identity.object_id,
)
role_definition_name = "Key Vault Secrets User"
}
resource "azurerm_role_assignment" "key_vault_secret_officer__current" {
Expand Down

0 comments on commit b6276d3

Please sign in to comment.