-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
69 lines (61 loc) · 1.54 KB
/
main.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
59
60
61
62
63
64
65
66
67
68
69
data "azurerm_client_config" "current" {}
resource "azurerm_key_vault" "this" {
name = var.name == "" ? "${var.product}-${var.env}" : var.name
location = var.location
resource_group_name = var.resource_group_name
enabled_for_disk_encryption = true
tenant_id = data.azurerm_client_config.current.tenant_id
soft_delete_retention_days = 90
purge_protection_enabled = var.purge_protection_enabled
sku_name = var.sku
network_acls {
bypass = "AzureServices"
default_action = var.network_acls_default_action
ip_rules = var.network_acls_ip_rules
virtual_network_subnet_ids = var.network_acls_allowed_subnet_ids
}
}
resource "azurerm_key_vault_access_policy" "agent_access" {
key_vault_id = azurerm_key_vault.this.id
object_id = data.azurerm_client_config.current.object_id
tenant_id = data.azurerm_client_config.current.tenant_id
certificate_permissions = [
"Create",
"Delete",
"DeleteIssuers",
"Get",
"GetIssuers",
"Import",
"List",
"ListIssuers",
"SetIssuers",
"Update",
"ManageContacts",
"ManageIssuers",
]
key_permissions = [
"Create",
"List",
"Get",
"Delete",
"Update",
"Import",
"Backup",
"Restore",
"Decrypt",
"Encrypt",
"UnwrapKey",
"WrapKey",
"Sign",
"Verify",
"GetRotationPolicy",
]
secret_permissions = [
"Set",
"List",
"Get",
"Delete",
"Recover",
"Purge",
]
}