|
1 | 1 | // Demo terraform has a complex configuration. |
| 2 | +// CODER_WORKSPACE_OWNER_GROUPS='["admin","developer"]' terraform apply |
| 3 | +// |
| 4 | +// Some run options |
| 5 | +// preview -v Team=backend -g admin |
| 6 | +// preview -v Team=backend -g admin -g sa-saopaulo |
2 | 7 | terraform { |
3 | 8 | required_providers { |
4 | 9 | coder = { |
5 | 10 | source = "coder/coder" |
6 | 11 | } |
7 | | - } |
8 | | -} |
9 | | - |
10 | | - |
11 | | -locals { |
12 | | - fe_codes = ["PS", "WS"] |
13 | | - be_codes = ["CL", "GO", "IU", "PY"] |
14 | | - teams = { |
15 | | - "frontend" = { |
16 | | - "display_name" = "Frontend", |
17 | | - "codes" = local.fe_codes, |
18 | | - "description" = "The team that works on the frontend.", |
19 | | - "icon" = "/icon/desktop.svg" |
20 | | - }, |
21 | | - "backend" = { |
22 | | - "display_name" = "Backend", |
23 | | - "codes" = local.be_codes, |
24 | | - "description" = "The team that works on the backend.", |
25 | | - "icon" = "/emojis/2699.png", |
26 | | - }, |
27 | | - "fullstack" = { |
28 | | - "display_name" = "Fullstack", |
29 | | - "codes" = concat(local.be_codes, local.fe_codes), |
30 | | - "description" = "The team that works on both the frontend and backend.", |
31 | | - "icon" = "/emojis/1f916.png", |
| 12 | + docker = { |
| 13 | + source = "kreuzwerker/docker" |
| 14 | + version = "3.0.2" |
32 | 15 | } |
33 | 16 | } |
34 | 17 | } |
35 | 18 |
|
36 | | -data "coder_parameter" "team" { |
37 | | - name = "Team" |
38 | | - description = "Which team are you on?" |
39 | | - type = "string" |
40 | | - default = "fullstack" |
41 | | - order = 1 |
42 | 19 |
|
43 | | - dynamic "option" { |
44 | | - for_each = local.teams |
45 | | - content { |
46 | | - name = option.value.display_name |
47 | | - value = option.key |
48 | | - description = option.value.description |
49 | | - icon = option.value.icon |
50 | | - } |
51 | | - } |
52 | | - |
53 | | - validation { |
54 | | - regex = "^frontend|backend|fullstack$" |
55 | | - error = "You must select either frontend, backend, or fullstack." |
56 | | - } |
57 | | -} |
| 20 | +data coder_workspace_owner "me" {} |
58 | 21 |
|
59 | 22 | module "jetbrains_gateway" { |
60 | 23 | count = 1 |
|
0 commit comments