generated from abbeylabs/abbey-starter-kit-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
67 lines (58 loc) · 1.51 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
locals {
account_name = ""
repo_name = ""
project_path = "github://${local.account_name}/${local.repo_name}"
policies_path = "${local.project_path}/policies"
}
resource "abbey_grant_kit" "vault_oncall_group" {
name = "vault_oncall_group"
description = "Assign me to the vault oncall group"
workflow = {
steps = [
{
reviewers = {
one_of = ["replace-me@example.com"] # CHANGEME
}
}
]
}
policies = [
{ bundle = local.policies_path }
]
output = {
location = "${local.project_path}/access.tf"
append = <<-EOT
resource "vault_identity_group_member_entity_ids" "vault_group_{{ .user.vault.user_id }}" { # {{ .user.email }}
exclusive = false
member_entity_ids = ["{{ .user.vault.user_id }}"]
group_id = vault_identity_group.oncall.id
}
EOT
}
}
resource "abbey_grant_kit" "vault_admin_policy" {
name = "vault_admin_policy"
description = "Assign the admin policy to my account"
workflow = {
steps = [
{
reviewers = {
one_of = ["replace-me@example.com"] # CHANGEME
}
}
]
}
policies = [
{ bundle = local.policies_path }
]
output = {
location = "${local.project_path}/access.tf"
append = <<-EOT
resource "vault_identity_entity_policies" "vault_policy_{{ .user.vault.user_id }}" { # {{ .user.email }}
exclusive = false
entity_id = "{{ .user.vault.user_id }}"
policies = [ vault_policy.admin_policy.name ]
}
EOT
}
}