generated from abbeylabs/abbey-starter-kit-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
69 lines (61 loc) · 1.59 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
terraform {
backend "http" {
address = "https://api.abbey.io/terraform-http-backend"
lock_address = "https://api.abbey.io/terraform-http-backend/lock"
unlock_address = "https://api.abbey.io/terraform-http-backend/unlock"
lock_method = "POST"
unlock_method = "POST"
}
required_providers {
abbey = {
source = "abbeylabs/abbey"
version = "0.2.3"
}
}
}
provider "abbey" {
# Configuration options
bearer_auth = var.abbey_token
}
resource "abbey_grant_kit" "abbey_demo_site" {
name = "Abbey_Demo_Site"
description = <<-EOT
Grants access to Abbey's Demo Page.
This Grant Kit uses a single-step Grant Workflow that requires only a single reviewer
from a list of reviewers to approve access.
EOT
workflow = {
steps = [
{
reviewers = {
one_of = ["arvil@abbey.so"]
}
}
]
}
policies = [
{ bundle = "github://arviln/quickstart-v2/policies" } # CHANGEME
]
output = {
# Replace with your own path pointing to where you want your access changes to manifest.
# Path is an RFC 3986 URI, such as `github://{organization}/{repo}/path/to/file.tf`.
location = "github://arviln/quickstart-v2/access.tf"
append = <<-EOT
resource "abbey_demo" "grant_read_write_access" {
permission = "read_write"
email = "{{ .data.system.abbey.abbey_identity }}"
}
EOT
}
}
resource "abbey_identity" "user_1" {
name = "User 1"
linked = jsonencode({
abbey = [
{
type = "AuthId"
value = "arvil@abbey.so" # CHANGEME
}
]
})
}