From dcdf1b49305c017aa62282925780d64cfbabe47c Mon Sep 17 00:00:00 2001 From: Michele Zanotti Date: Wed, 7 Aug 2024 18:50:01 +0200 Subject: [PATCH] fix rbac --- README.md | 6 +++--- main.tf | 6 +++--- tests/dev-provisioning/main.tf | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 42ce3fa..b908bfd 100644 --- a/README.md +++ b/README.md @@ -109,9 +109,9 @@ Available on [Terraform Registry](https://registry.terraform.io/modules/nebuly-a - resource.azurerm_role_assignment.aks_network_contributor (/terraform-docs/main.tf#613) - resource.azurerm_role_assignment.key_vault_secret_officer__current (/terraform-docs/main.tf#220) - resource.azurerm_role_assignment.key_vault_secret_user__aks (/terraform-docs/main.tf#215) -- resource.azurerm_role_assignment.storage_container_models__data_contributor (/terraform-docs/main.tf#514) -- resource.azurerm_storage_account.main (/terraform-docs/main.tf#490) -- resource.azurerm_storage_container.models (/terraform-docs/main.tf#510) +- resource.azurerm_role_assignment.storage_container_models__data_contributor (/terraform-docs/main.tf#512) +- resource.azurerm_storage_account.main (/terraform-docs/main.tf#488) +- resource.azurerm_storage_container.models (/terraform-docs/main.tf#508) - resource.azurerm_subnet.aks_nodes (/terraform-docs/main.tf#127) - resource.azurerm_subnet.flexible_postgres (/terraform-docs/main.tf#149) - resource.azurerm_subnet.private_endpints (/terraform-docs/main.tf#141) diff --git a/main.tf b/main.tf index aa45577..c132797 100644 --- a/main.tf +++ b/main.tf @@ -484,8 +484,6 @@ resource "azurerm_key_vault_secret" "azure_openai_api_key" { - - # ------ Model Registry ------ # resource "azurerm_storage_account" "main" { name = format("%s%s", var.resource_prefix, "models") @@ -513,11 +511,13 @@ resource "azurerm_storage_container" "models" { } resource "azurerm_role_assignment" "storage_container_models__data_contributor" { role_definition_name = "Storage Blob Data Contributor" - principal_id = azuread_service_principal.main.object_id + principal_id = module.aks.kubelet_identity[0].object_id scope = azurerm_storage_container.models.resource_manager_id } + + # ------ AKS ------ # resource "tls_private_key" "aks" { algorithm = "RSA" # Azure VMs currently do not support ECDSA diff --git a/tests/dev-provisioning/main.tf b/tests/dev-provisioning/main.tf index 1f5b83b..2793f47 100644 --- a/tests/dev-provisioning/main.tf +++ b/tests/dev-provisioning/main.tf @@ -26,6 +26,7 @@ provider "azurerm" { subscription_id = var.subscription_id } + # ------ Variables ------ # variable "resource_prefix" { type = string