-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
63 lines (59 loc) · 1.19 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
terraform {
required_providers {
coderd = {
source = "coder/coderd"
version = ">=0.0.0"
}
}
}
resource "coderd_user" "ethan" {
username = "ethan"
name = "Ethan Coolguy"
email = "[email protected]"
roles = ["owner", "template-admin"]
login_type = "password"
password = "SomeSecurePassword!"
suspended = false
}
data "coderd_organization" "default" {
is_default = true
}
resource "coderd_template" "sample" {
name = "example-template"
allow_user_auto_stop = false
allow_user_auto_start = false
acl = {
groups = [
{
id = data.coderd_organization.default.id
role = "use"
}
]
users = [
{
id = resource.coderd_user.ethan.id
role = "admin"
}
]
}
versions = [
{
directory = "./example-template-2"
active = true
tf_vars = {
name = "world"
}
},
{
directory = "./example-template-2"
active = false
tf_vars = {
name = "ethan"
}
}
]
}
data "coderd_template" "sample" {
organization_id = data.coderd_organization.default.id
name = coderd_template.sample.name
}