Skip to content

Commit c29960f

Browse files
committed
add display_name
1 parent e84061e commit c29960f

File tree

15 files changed

+175
-143
lines changed

15 files changed

+175
-143
lines changed

examples/templates/aws-ecs-container/main.tf

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
coder = {
44
source = "coder/coder"
5-
version = "~> 0.6.17"
5+
version = "~> 0.7.0"
66
}
77
aws = {
88
source = "hashicorp/aws"
@@ -20,19 +20,21 @@ variable "ecs-cluster" {
2020
}
2121

2222
data "coder_parameter" "cpu" {
23-
name = "cpu"
24-
description = "The number of CPU units to reserve for the container"
25-
type = "number"
26-
default = "1024"
27-
mutable = true
23+
name = "cpu"
24+
display_name = "CPU"
25+
description = "The number of CPU units to reserve for the container"
26+
type = "number"
27+
default = "1024"
28+
mutable = true
2829
}
2930

3031
data "coder_parameter" "memory" {
31-
name = "memory"
32-
description = "The amount of memory (in MiB) to allow the container to use"
33-
type = "number"
34-
default = "2048"
35-
mutable = true
32+
name = "memory"
33+
display_name = "Memory"
34+
description = "The amount of memory (in MiB) to allow the container to use"
35+
type = "number"
36+
default = "2048"
37+
mutable = true
3638
}
3739

3840
# configure AWS provider with creds present on Coder server host

examples/templates/aws-linux/main.tf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
coder = {
44
source = "coder/coder"
5-
version = "~> 0.6.17"
5+
version = "~> 0.7.0"
66
}
77
aws = {
88
source = "hashicorp/aws"
@@ -14,10 +14,11 @@ terraform {
1414
# Last updated 2023-03-14
1515
# aws ec2 describe-regions | jq -r '[.Regions[].RegionName] | sort'
1616
data "coder_parameter" "region" {
17-
name = "Region"
18-
description = "The region to deploy the workspace in."
19-
default = "us-east-1"
20-
mutable = false
17+
name = "region"
18+
display_name = "Region"
19+
description = "The region to deploy the workspace in."
20+
default = "us-east-1"
21+
mutable = false
2122
option {
2223
name = "Asia Pacific (Tokyo)"
2324
value = "ap-northeast-1"
@@ -106,10 +107,11 @@ data "coder_parameter" "region" {
106107
}
107108

108109
data "coder_parameter" "instance_type" {
109-
name = "Instance Type"
110-
description = "What instance type should your workspace use?"
111-
default = "t3.micro"
112-
mutable = false
110+
name = "instance_type"
111+
display_name = "Instance Type"
112+
description = "What instance type should your workspace use?"
113+
default = "t3.micro"
114+
mutable = false
113115
option {
114116
name = "2 vCPU, 1 GiB RAM"
115117
value = "t3.micro"

examples/templates/aws-windows/main.tf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
coder = {
44
source = "coder/coder"
5-
version = "~> 0.6.17"
5+
version = "~> 0.7.0"
66
}
77
aws = {
88
source = "hashicorp/aws"
@@ -14,10 +14,11 @@ terraform {
1414
# Last updated 2023-03-14
1515
# aws ec2 describe-regions | jq -r '[.Regions[].RegionName] | sort'
1616
data "coder_parameter" "region" {
17-
name = "Region"
18-
description = "The region to deploy the workspace in."
19-
default = "us-east-1"
20-
mutable = false
17+
name = "region"
18+
display_name = "Region"
19+
description = "The region to deploy the workspace in."
20+
default = "us-east-1"
21+
mutable = false
2122
option {
2223
name = "Asia Pacific (Tokyo)"
2324
value = "ap-northeast-1"
@@ -106,10 +107,11 @@ data "coder_parameter" "region" {
106107
}
107108

108109
data "coder_parameter" "instance_type" {
109-
name = "Instance Type"
110-
description = "What instance type should your workspace use?"
111-
default = "t3.micro"
112-
mutable = false
110+
name = "instance_type"
111+
dsiplay_name = "Instance Type"
112+
description = "What instance type should your workspace use?"
113+
default = "t3.micro"
114+
mutable = false
113115
option {
114116
name = "2 vCPU, 1 GiB RAM"
115117
value = "t3.micro"

examples/templates/azure-linux/main.tf

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
coder = {
44
source = "coder/coder"
5-
version = "~> 0.6.17"
5+
version = "~> 0.7.0"
66
}
77
azurerm = {
88
source = "hashicorp/azurerm"
@@ -12,11 +12,12 @@ terraform {
1212
}
1313

1414
data "coder_parameter" "location" {
15-
name = "Location"
16-
description = "What location should your workspace live in?"
17-
default = "eastus"
18-
icon = "/emojis/1f310.png"
19-
mutable = false
15+
name = "location"
16+
display_name = "Location"
17+
description = "What location should your workspace live in?"
18+
default = "eastus"
19+
icon = "/emojis/1f310.png"
20+
mutable = false
2021
option {
2122
name = "US (Virginia)"
2223
value = "eastus"
@@ -150,7 +151,8 @@ data "coder_parameter" "location" {
150151
}
151152

152153
data "coder_parameter" "instance_type" {
153-
name = "Instance Type"
154+
name = "instance_type"
155+
display = "Instance Type"
154156
description = "What instance type should your workspace use?"
155157
default = "Standard_B4ms"
156158
icon = "/icon/azure.png"
@@ -202,7 +204,8 @@ data "coder_parameter" "instance_type" {
202204
}
203205

204206
data "coder_parameter" "home_size" {
205-
name = "Home Volume Size"
207+
name = "home_size"
208+
display = "Home Volume Size"
206209
description = "How large would you like your home volume to be (in GB)?"
207210
default = 20
208211
type = "number"

examples/templates/do-linux/main.tf

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
coder = {
44
source = "coder/coder"
5-
version = "~> 0.6.17"
5+
version = "~> 0.7.0"
66
}
77
digitalocean = {
88
source = "digitalocean/digitalocean"
@@ -52,10 +52,12 @@ variable "step2_do_admin_ssh_key" {
5252
}
5353

5454
data "coder_parameter" "droplet_image" {
55-
name = "Which Droplet image would you like to use for your workspace?"
56-
default = "ubuntu-22-04-x64"
57-
type = "string"
58-
mutable = false
55+
name = "droplet_image"
56+
display_name = "Droplet Image"
57+
description = "Which Droplet image would you like to use?"
58+
default = "ubuntu-22-04-x64"
59+
type = "string"
60+
mutable = false
5961
option {
6062
name = "Ubuntu 22.04"
6163
value = "ubuntu-22-04-x64"
@@ -109,11 +111,13 @@ data "coder_parameter" "droplet_image" {
109111
}
110112

111113
data "coder_parameter" "droplet_size" {
112-
name = "Which Droplet configuration would you like to use?"
113-
default = "s-1vcpu-1gb"
114-
type = "string"
115-
icon = "/icon/memory.svg"
116-
mutable = false
114+
name = "droplet_size"
115+
display_name = "Droplet Size"
116+
description = "Which Droplet configuration would you like to use?"
117+
default = "s-1vcpu-1gb"
118+
type = "string"
119+
icon = "/icon/memory.svg"
120+
mutable = false
117121
option {
118122
name = "1 vCPU, 1 GB RAM"
119123
value = "s-1vcpu-1gb"
@@ -142,24 +146,26 @@ data "coder_parameter" "droplet_size" {
142146

143147

144148
data "coder_parameter" "home_volume_size" {
145-
name = "How large would you like your home volume to be (in GB)?"
146-
description = "This volume will be mounted to /home/coder."
147-
type = "number"
148-
default = "20"
149-
mutable = false
149+
name = "home_volume_size"
150+
display_name = "How large would you like your home volume to be (in GB)?"
151+
description = "This volume will be mounted to /home/coder."
152+
type = "number"
153+
default = "20"
154+
mutable = false
150155
validation {
151156
min = 1
152157
max = 999999
153158
}
154159
}
155160

156161
data "coder_parameter" "region" {
157-
name = "Which region would you like to use?"
158-
description = "This is the region where your workspace will be created."
159-
icon = "/emojis/1f30e.png"
160-
type = "string"
161-
default = "ams3"
162-
mutable = false
162+
name = "region"
163+
display_name = "Which region would you like to use?"
164+
description = "This is the region where your workspace will be created."
165+
icon = "/emojis/1f30e.png"
166+
type = "string"
167+
default = "ams3"
168+
mutable = false
163169
option {
164170
name = "New York 1"
165171
value = "nyc1"

examples/templates/docker-code-server/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
coder = {
44
source = "coder/coder"
5-
version = "~> 0.6.17"
5+
version = "~> 0.7.0"
66
}
77
docker = {
88
source = "kreuzwerker/docker"

examples/templates/docker-image-builds/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
coder = {
55
source = "coder/coder"
6-
version = "~> 0.6.17"
6+
version = "~> 0.7.0"
77
}
88
docker = {
99
source = "kreuzwerker/docker"

examples/templates/docker-with-dotfiles/main.tf

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ terraform {
99
required_providers {
1010
coder = {
1111
source = "coder/coder"
12-
version = "~> 0.6.17"
12+
version = "~> 0.7.0"
1313
}
1414
docker = {
1515
source = "kreuzwerker/docker"
@@ -28,24 +28,26 @@ data "coder_workspace" "me" {
2828
}
2929

3030
data "coder_parameter" "docker_image" {
31-
name = "What Docker image would you like to use for your workspace?"
32-
description = "The Docker image will be used to build your workspace."
33-
default = "codercom/enterprise-base:ubuntu"
34-
icon = "/icon/docker.png"
35-
type = "string"
36-
mutable = false
31+
name = "docker_image"
32+
display_name = "What Docker image would you like to use for your workspace?"
33+
description = "The Docker image will be used to build your workspace."
34+
default = "codercom/enterprise-base:ubuntu"
35+
icon = "/icon/docker.png"
36+
type = "string"
37+
mutable = false
3738
}
3839

3940
data "coder_parameter" "dotfiles_uri" {
40-
name = "What dotfiles repo would you like to use for your workspace?"
41-
description = <<-EOF
41+
name = "dotfiles_uri"
42+
display_name = "What dotfiles repo would you like to use for your workspace?"
43+
description = <<-EOF
4244
Dotfiles repo URI (optional)
4345
4446
see https://dotfiles.github.io
4547
EOF
46-
default = ""
47-
type = "string"
48-
mutable = true
48+
default = ""
49+
type = "string"
50+
mutable = true
4951
}
5052

5153
resource "coder_agent" "main" {

examples/templates/docker/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
coder = {
44
source = "coder/coder"
5-
version = "~> 0.6.17"
5+
version = "~> 0.7.0"
66
}
77
docker = {
88
source = "kreuzwerker/docker"

0 commit comments

Comments
 (0)