Skip to content

Commit

Permalink
fix: rbac and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Telemaco019 committed Aug 12, 2024
1 parent dcdf1b4 commit 3762ec2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ 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]) > 0 ? 1 : 0

scope = azurerm_key_vault.main.id
principal_id = module.aks.cluster_identity.principal_id
principal_id = module.aks.key_vault_secrets_provider.secret_identity[0].object_id
role_definition_name = "Key Vault Secrets User"
}
resource "azurerm_role_assignment" "key_vault_secret_officer__current" {
Expand Down Expand Up @@ -507,7 +509,7 @@ resource "azurerm_storage_account" "main" {
}
resource "azurerm_storage_container" "models" {
storage_account_name = azurerm_storage_account.main.name
name = "ai-models"
name = "models"
}
resource "azurerm_role_assignment" "storage_container_models__data_contributor" {
role_definition_name = "Storage Blob Data Contributor"
Expand Down Expand Up @@ -712,7 +714,7 @@ locals {

key_vault_name = azurerm_key_vault.main.name
tenant_id = data.azurerm_client_config.current.tenant_id
aks_managed_identity_id = try(module.aks.key_vault_secrets_provider.secret_identity[0].object_id, "TODO")
aks_managed_identity_id = try(module.aks.key_vault_secrets_provider.secret_identity[0].client_id, "TODO")

secret_name_jwt_signing_key = azurerm_key_vault_secret.jwt_signing_key.name
secret_name_db_username = azurerm_key_vault_secret.postgres_user.name
Expand Down
9 changes: 9 additions & 0 deletions tests/dev-provisioning/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ module "platform" {
tags = var.tags
}


output "secret_provider_class" {
value = module.platform.secret_provider_class
sensitive = true
}
output "helm_values" {
value = module.platform.helm_values
sensitive = true
}

0 comments on commit 3762ec2

Please sign in to comment.