-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
64 lines (53 loc) · 1.38 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
locals {
account_name = ""
repo_name = ""
project_path = "github://${local.account_name}/${local.repo_name}"
policies_path = "${local.project_path}/policies"
gcp_member = "{{ .user.google.id }}"
gcp_customer_id = "replace-me"
}
resource "google_cloud_identity_group" "abbey-gcp-quickstart" {
display_name = "abbey-gcp-quickstart"
initial_group_config = "WITH_INITIAL_OWNER"
# Replace with your customer ID
parent = "customers/${local.gcp_customer_id}"
group_key {
# choose a unique group ID
id = "[email protected]"
}
labels = {
"cloudidentity.googleapis.com/groups.discussion_forum" = ""
}
}
resource "abbey_grant_kit" "abbey_gcp_identity_quickstart" {
name = "Abbey-GCP-Identity-Quickstart"
description = <<-EOT
Grants access to Abbey's GCP Group for the Quickstart.
EOT
workflow = {
steps = [
{
reviewers = {
one_of = ["[email protected]"] # CHANGEME
}
}
]
}
policies = [
{ bundle = local.policies_path }
]
output = {
location = "${local.project_path}/access.tf"
append = <<-EOT
resource "google_cloud_identity_group_membership" "member" {
group = google_cloud_identity_group.abbey-gcp-quickstart.id
roles {
name = "MEMBER"
}
preferred_member_key {
id = local.gcp_member
}
}
EOT
}
}