-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathmain.tf
62 lines (52 loc) · 1.15 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
terraform {
required_providers {
coder = {
source = "coder/coder"
}
local = {
source = "hashicorp/local"
}
}
}
data "coder_workspace" "me" {}
resource "coder_agent" "dev" {
os = "linux"
arch = "amd64"
dir = "/workspace"
}
resource "coder_app" "window" {
agent_id = coder_agent.dev.id
slug = "window"
share = "owner"
open_in = "window"
}
resource "coder_app" "slim-window" {
agent_id = coder_agent.dev.id
slug = "slim-window"
share = "owner"
open_in = "slim-window"
}
resource "coder_app" "defaulted" {
agent_id = coder_agent.dev.id
slug = "defaulted"
share = "owner"
}
locals {
# NOTE: these must all be strings in the output
output = {
"coder_app.window.open_in" = tostring(coder_app.window.open_in)
"coder_app.slim-window.open_in" = tostring(coder_app.slim-window.open_in)
"coder_app.defaulted.open_in" = tostring(coder_app.defaulted.open_in)
}
}
variable "output_path" {
type = string
}
resource "local_file" "output" {
filename = var.output_path
content = jsonencode(local.output)
}
output "output" {
value = local.output
sensitive = true
}