-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkey_vault.tf
36 lines (32 loc) · 1.36 KB
/
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
// Key Vault for pipeline secrets
resource "azurerm_key_vault" "terraform" {
name = "${var.key_vault_prefix}${random_id.azurerm_random_id.hex}"
location = azurerm_resource_group.terraform.location
resource_group_name = azurerm_resource_group.terraform.name
enabled_for_disk_encryption = false
enable_rbac_authorization = true
tenant_id = data.azurerm_client_config.current.tenant_id
soft_delete_retention_days = 7
purge_protection_enabled = false
sku_name = "standard"
network_acls {
default_action = "Allow"
bypass = "None"
}
}
resource "azurerm_private_endpoint" "keyvault_endpoint" {
name = "${var.key_vault_prefix}${random_id.azurerm_random_id.hex}-kvendpoint"
location = var.location
resource_group_name = azurerm_resource_group.terraform.name
subnet_id = azurerm_subnet.estf.id
private_dns_zone_group {
name = "vault"
private_dns_zone_ids = [azurerm_private_dns_zone.keyvault.id]
}
private_service_connection {
name = "${var.key_vault_prefix}${random_id.azurerm_random_id.hex}-kvserviceconnection"
private_connection_resource_id = azurerm_key_vault.terraform.id
subresource_names = ["vault"]
is_manual_connection = false
}
}