generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 11
/
role_assignments.tf
17 lines (15 loc) · 1.06 KB
/
role_assignments.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
locals {
role_definition_resource_substring = "Cognitive Services"
}
resource "azurerm_role_assignment" "this" {
for_each = var.role_assignments
principal_id = each.value.principal_id
scope = azurerm_cognitive_account.this.id
condition = each.value.condition
condition_version = each.value.condition_version
delegated_managed_identity_resource_id = each.value.delegated_managed_identity_resource_id
principal_type = each.value.principal_type
role_definition_id = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? null : each.value.role_definition_id_or_name
role_definition_name = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? each.value.role_definition_id_or_name : null
skip_service_principal_aad_check = each.value.skip_service_principal_aad_check
}