-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathr-keyvault.tf
41 lines (30 loc) · 1.21 KB
/
r-keyvault.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
resource "azurerm_key_vault" "main" {
count = var.managed_hardware_security_module_enabled ? 0 : 1
name = local.name
location = var.location
resource_group_name = var.resource_group_name
tenant_id = local.tenant_id
sku_name = var.sku_name
enabled_for_deployment = var.enabled_for_deployment
enabled_for_disk_encryption = var.enabled_for_disk_encryption
enabled_for_template_deployment = var.enabled_for_template_deployment
purge_protection_enabled = var.purge_protection_enabled
soft_delete_retention_days = var.soft_delete_retention_days
enable_rbac_authorization = var.rbac_authorization_enabled
public_network_access_enabled = var.public_network_access_enabled
dynamic "network_acls" {
for_each = var.network_acls == null ? [] : [var.network_acls]
iterator = acl
content {
bypass = acl.value.bypass
default_action = acl.value.default_action
ip_rules = acl.value.ip_rules
virtual_network_subnet_ids = acl.value.virtual_network_subnet_ids
}
}
tags = merge(local.default_tags, var.extra_tags)
}
moved {
from = azurerm_key_vault.keyvault[0]
to = azurerm_key_vault.main[0]
}