generated from abbeylabs/abbey-starter-kit-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
89 lines (77 loc) · 1.94 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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.2"
}
null = {
source = "hashicorp/null"
version = "3.2.1"
}
random = {
source = "hashicorp/random"
version = "3.4.3"
}
}
}
provider "abbey" {
# Configuration options
bearer_auth = var.abbey_token
}
provider "null" {
# Configuration options
}
provider "random" {
# Configuration options
}
resource "abbey_grant_kit" "null_grant" {
name = "Null_grant"
description = <<-EOT
Grants access to a Null Resource.
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 = {
# Typically uses your Primary Identity.
# For this local example, you can pass in an arbitrary string.
# For more information on what a Primary Identity is, visit https://docs.abbey.io.
one_of = ["[email protected]"]
}
}
]
}
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/abbey-quick-start/access.tf"
append = <<-EOT
resource "null_resource" "null_grant_${random_pet.random_pet_name.id}" {
}
EOT
}
}
resource "abbey_identity" "user_1" {
name = "User 1"
linked = jsonencode({
abbey = [
{
type = "AuthId"
value = "[email protected]"
}
]
})
}
resource "random_pet" "random_pet_name" {
length = 5
separator = "_"
}