Skip to content

Commit f2a3316

Browse files
authored
Add default values to parameters so template build
Without default values, when editing this template in the Coder UI, the "Build Template" button produces a "parameter not defined" error. This resolves the error and allows the template to build. Not sure if there's a better way but this worked for me.
1 parent b4d913e commit f2a3316

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/templates/envbox/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,48 +34,56 @@ variable "use_kubeconfig" {
3434
Set this to true if the Coder host is running outside the Kubernetes cluster
3535
for workspaces. A valid "~/.kube/config" must be present on the Coder host.
3636
EOF
37+
default = false
3738
}
3839

3940
variable "namespace" {
4041
type = string
4142
sensitive = true
4243
description = "The namespace to create workspaces in (must exist prior to creating workspaces)"
44+
default = "default"
4345
}
4446

4547
variable "create_tun" {
4648
type = bool
4749
sensitive = true
4850
description = "Add a TUN device to the workspace."
51+
default = false
4952
}
5053

5154
variable "create_fuse" {
5255
type = bool
5356
description = "Add a FUSE device to the workspace."
5457
sensitive = true
58+
default = false
5559
}
5660

5761
variable "max_cpus" {
5862
type = string
5963
sensitive = true
6064
description = "Max number of CPUs the workspace may use (e.g. 2)."
65+
default = "2"
6166
}
6267

6368
variable "min_cpus" {
6469
type = string
6570
sensitive = true
6671
description = "Minimum number of CPUs the workspace may use (e.g. .1)."
72+
default = "2"
6773
}
6874

6975
variable "max_memory" {
7076
type = string
7177
description = "Maximum amount of memory to allocate the workspace (in GB)."
7278
sensitive = true
79+
default = "4"
7380
}
7481

7582
variable "min_memory" {
7683
type = string
7784
description = "Minimum amount of memory to allocate the workspace (in GB)."
7885
sensitive = true
86+
default = "4"
7987
}
8088

8189
provider "kubernetes" {

0 commit comments

Comments
 (0)