I am creating a terraform plan to setup some resources (among others an AKS cluster) in Azure. For the use of the cluster, I've created a service principal that is allowed "acrpull" role with the docker registry (I did that using the innovationnorway/service-principal/azuread
module, while for everything else I created my own stuff).
As my next step, I need to assign a "Network Contributor" role for this service principal on the resource group (which I also create) -> basically to replicate the assignment suggested here.
For that I am doing this
resource "azurerm_role_assignment" "network_contributor" {
scope = module.resource_group.resource_group_id
role_definition_name = "Network Contributor"
principal_id = module.service_principal.object_id
}
However, I am not seeing the expected results (eg: the cluster able to use a static IP created in my main resource group from the RG automatically created for the cluster).
Am I doing something wrong? I am not getting errors and the cluster is able to access the registry, for example.
Thanks!