-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresources.role_assignments.tf
28 lines (23 loc) · 1.04 KB
/
resources.role_assignments.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
resource "azurerm_role_assignment" "enterprise_scale" {
for_each = local.azurerm_role_assignment_enterprise_scale
# Special handling of OPTIONAL name to ensure consistent and correct
# mapping of Terraform state ADDR value to Azure Resource ID value.
name = basename(each.key)
# Mandatory resource attributes
scope = each.value.scope_id
principal_id = each.value.principal_id
# Optional attributes
role_definition_name = try(length(each.value.role_definition_name) > 0, false) ? each.value.role_definition_name : null
role_definition_id = null // Not currently used
skip_service_principal_aad_check = null // Not currently used
# Set explicit dependency on Management Group and Role Definition deployments
depends_on = [
azurerm_management_group.level_1,
azurerm_management_group.level_2,
azurerm_management_group.level_3,
azurerm_management_group.level_4,
azurerm_management_group.level_5,
azurerm_management_group.level_6,
azurerm_role_definition.enterprise_scale,
]
}