Skip to content

Commit fa6d181

Browse files
matifalibpmct
andauthored
Update posts/how-to-create-coder-templates/index.md
Co-authored-by: Ben Potter <me@bpmct.net>
1 parent f2103fd commit fa6d181

File tree

1 file changed

+9
-10
lines changed
  • posts/how-to-create-coder-templates

1 file changed

+9
-10
lines changed

posts/how-to-create-coder-templates/index.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ There are many ways to organize your templates:
2121
A template is a collection of infrastructure as code (Terraform) used to create workspaces. An image is a collection of software (e.g. Docker) that is used to create a workspace. A template can use one or more images. For example, you can have a template that uses the _golang_ image and the _node_ image, and the user will have the choice of which image to use when creating a workspace. Choices are managed by a terraform variable:
2222

2323
```hcl
24-
variable "image" {
25-
type = string
26-
description = "The image to use for the workspace"
27-
default = "ubuntu"
28-
validation {
29-
condition = contains(["ubuntu", "node"], var.image)
30-
error_message = "The image must be either ubuntu or node"
31-
}
32-
}
33-
```
24+
variable "image" {
25+
type = string
26+
description = "The image to use for the workspace"
27+
default = "ubuntu"
28+
validation {
29+
condition = contains(["ubuntu", "node"], var.image)
30+
error_message = "The image must be either ubuntu or node"
31+
}
32+
}
3433
3534
## Creating your first template
3635

0 commit comments

Comments
 (0)