-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathavm.key_vault.tf
58 lines (51 loc) · 1.6 KB
/
avm.key_vault.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
module "key_vault" {
source = "Azure/avm-res-keyvault-vault/azurerm"
version = "0.9.1"
name = local.key_vault_name
location = var.location
resource_group_name = module.resource_group.name
tenant_id = data.azurerm_client_config.current.tenant_id
public_network_access_enabled = true
keys = {
cmk_for_storage_account = {
key_opts = [
"decrypt",
"encrypt",
"sign",
"unwrapKey",
"verify",
"wrapKey"
]
key_type = "RSA"
name = "cmk-for-storage-account"
key_size = 2048
}
}
private_endpoints = {
primary = {
private_dns_zone_resource_ids = [module.private_dns_zone_key_vault.resource_id]
subnet_resource_id = module.virtual_network.subnets["private_endpoints"].resource_id
subresource_name = ["vault"]
tags = var.tags
}
}
role_assignments = {
deployment_user_secrets = {
role_definition_id_or_name = "Key Vault Administrator"
principal_id = data.azurerm_client_config.current.object_id
}
customer_managed_key = {
role_definition_id_or_name = "Key Vault Crypto Service Encryption User"
principal_id = module.user_assigned_managed_identity.principal_id
}
}
wait_for_rbac_before_key_operations = {
create = "60s"
}
network_acls = {
bypass = "AzureServices"
ip_rules = [local.my_cidr_slash_24]
}
diagnostic_settings = local.diagnostic_settings
tags = var.tags
}