forked from bridgecrewio/terragoat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkey_vault.tf
72 lines (70 loc) · 2.45 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
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
70
71
72
resource "azurerm_key_vault" "example" {
name = "terragoat-key-${var.environment}${random_integer.rnd_int.result}"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "premium"
access_policy {
tenant_id = data.azurerm_client_config.current.tenant_id
object_id = data.azurerm_client_config.current.object_id
key_permissions = [
"create",
"get",
]
secret_permissions = [
"set",
]
}
tags = merge({
environment = var.environment
terragoat = true
}, {
git_commit = "81738b80d571fa3034633690d13ffb460e1e7dea"
git_file = "terraform/azure/key_vault.tf"
git_last_modified_at = "2020-06-19 21:14:50"
git_last_modified_by = "Adin.Ermie@outlook.com"
git_modifiers = "Adin.Ermie/nimrodkor"
git_org = "bridgecrewio"
git_repo = "terragoat"
yor_trace = "79afeacc-248a-4015-a4fa-76a6a57f06e2"
})
}
resource "azurerm_key_vault_key" "generated" {
name = "terragoat-generated-certificate-${var.environment}"
key_vault_id = azurerm_key_vault.example.id
key_type = "RSA"
key_size = 2048
key_opts = [
"decrypt",
"encrypt",
"sign",
"unwrapKey",
"verify",
"wrapKey",
]
tags = {
git_commit = "898d5beaec7ffdef6df0d7abecff407362e2a74e"
git_file = "terraform/azure/key_vault.tf"
git_last_modified_at = "2020-06-17 12:59:55"
git_last_modified_by = "nimrodkor@gmail.com"
git_modifiers = "nimrodkor"
git_org = "bridgecrewio"
git_repo = "terragoat"
yor_trace = "afbc6e13-63d9-4e6c-8914-d58b7744b5dd"
}
}
resource "azurerm_key_vault_secret" "secret" {
key_vault_id = azurerm_key_vault.example.id
name = "terragoat-secret-${var.environment}"
value = random_string.password.result
tags = {
git_commit = "f8ff847bb69370bbe03b3d2b70db586ff6c867fc"
git_file = "terraform/azure/key_vault.tf"
git_last_modified_at = "2020-06-19 21:16:08"
git_last_modified_by = "Adin.Ermie@outlook.com"
git_modifiers = "Adin.Ermie/nimrodkor"
git_org = "bridgecrewio"
git_repo = "terragoat"
yor_trace = "40517524-f05d-485b-bfbe-3fa0dbee511e"
}
}