Skip to content

Commit f0fa093

Browse files
author
Richard Cheney
committed
Managed identity access policy to key vault
1 parent e434917 commit f0fa093

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

key_vault.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ resource "azurerm_key_vault_access_policy" "service_principal" {
3535
]
3636
}
3737

38+
resource "azurerm_key_vault_access_policy" "managed_identity" {
39+
key_vault_id = azurerm_key_vault.hub.id
40+
41+
tenant_id = data.azurerm_client_config.current.tenant_id
42+
object_id = azurerm_user_assigned_identity.hub.principal_id
43+
44+
key_permissions = [
45+
"Get",
46+
"List",
47+
]
48+
49+
secret_permissions = [
50+
"Get",
51+
"List",
52+
]
53+
}
54+
3855
output "key_vault" {
3956
value = azurerm_key_vault.hub
4057
}

0 commit comments

Comments
 (0)