-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathr-rbac.tf
38 lines (30 loc) · 1.35 KB
/
r-rbac.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
29
30
31
32
33
34
35
36
37
38
resource "azurerm_role_assignment" "key_vault_administrator" {
for_each = toset(var.rbac_authorization_enabled && !var.managed_hardware_security_module_enabled ? var.admin_objects_ids : [])
scope = one(azurerm_key_vault.main[*].id)
role_definition_name = "Key Vault Administrator"
principal_id = each.value
}
moved {
from = azurerm_role_assignment.rbac_keyvault_administrator
to = azurerm_role_assignment.key_vault_administrator
}
resource "azurerm_role_assignment" "key_vault_secrets_users" {
for_each = toset(var.rbac_authorization_enabled && !var.managed_hardware_security_module_enabled ? var.reader_objects_ids : [])
scope = one(azurerm_key_vault.main[*].id)
role_definition_name = "Key Vault Secrets User"
principal_id = each.value
}
moved {
from = azurerm_role_assignment.rbac_keyvault_secrets_users
to = azurerm_role_assignment.key_vault_secrets_users
}
resource "azurerm_role_assignment" "key_vault_reader" {
for_each = toset(var.rbac_authorization_enabled && !var.managed_hardware_security_module_enabled ? var.reader_objects_ids : [])
scope = one(azurerm_key_vault.main[*].id)
role_definition_name = "Key Vault Reader"
principal_id = each.value
}
moved {
from = azurerm_role_assignment.rbac_keyvault_reader
to = azurerm_role_assignment.key_vault_reader
}