@@ -82,28 +82,22 @@ Refer to the following resources to build your own templates:
82
82
83
83
- Terraform: [ Documentation] ( https://developer.hashicorp.com/terraform/docs ) and
84
84
[ Registry] ( https://registry.terraform.io )
85
- - Common [ concepts in templates] ( #concepts-in-templates ) and [ Coder Terraform
86
- provider] ( https://registry.terraform.io/providers/coder/coder/latest/docs )
87
- - [ Coder example
88
- templates] ( https://github.com/coder/coder/tree/main/examples/templates ) code
85
+ - Common [ concepts in templates] ( #concepts-in-templates ) and [ Coder Terraform provider] ( https://registry.terraform.io/providers/coder/coder/latest/docs )
86
+ - [ Coder example templates] ( https://github.com/coder/coder/tree/main/examples/templates ) code
89
87
90
88
## Concepts in templates
91
89
92
- While templates are written with standard Terraform, the [ Coder Terraform
93
- Provider] ( https://registry.terraform.io/providers/coder/coder/latest/docs ) is
94
- used to define the workspace lifecycle and establish a connection from resources
90
+ While templates are written with standard Terraform, the [ Coder Terraform Provider] ( https://registry.terraform.io/providers/coder/coder/latest/docs ) is used to define the workspace lifecycle and establish a connection from resources
95
91
to Coder.
96
92
97
93
Below is an overview of some key concepts in templates (and workspaces). For all
98
- template options, reference [ Coder Terraform provider
99
- docs] ( https://registry.terraform.io/providers/coder/coder/latest/docs ) .
94
+ template options, reference [ Coder Terraform provider docs] ( https://registry.terraform.io/providers/coder/coder/latest/docs ) .
100
95
101
96
### Resource
102
97
103
- Resources in Coder are simply [ Terraform
104
- resources] ( https://www.terraform.io/language/resources ) . If a Coder agent is
105
- attached to a resource, users can connect directly to the resource over SSH or
106
- web apps.
98
+ Resources in Coder are simply [ Terraform resources] ( https://www.terraform.io/language/resources ) .
99
+ If a Coder agent is attached to a resource, users can connect directly to the
100
+ resource over SSH or web apps.
107
101
108
102
### Coder agent
109
103
@@ -140,11 +134,11 @@ resource "kubernetes_pod" "pod1" {
140
134
}
141
135
```
142
136
143
- The ` coder_agent ` resource can be configured as described in the [ documentation
144
- for the ` coder ` Terraform
145
- provider. ] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/ agent)
146
- For example, you can use the ` env ` property to set environment variables that
147
- will be inherited by all child processes of the agent, including SSH sessions .
137
+ The ` coder_agent ` resource can be configured with additional arguments. For example,
138
+ you can use the ` env ` property to set environment variables that will be inherited
139
+ by all child processes of the agent, including SSH sessions. See the
140
+ [ Coder Terraform Provider documentation ] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent )
141
+ for the full list of supported arguments for the ` coder_agent ` .
148
142
149
143
#### startup_script
150
144
@@ -222,9 +216,8 @@ resource "docker_image" "workspace" {
222
216
223
217
Coder workspaces can be started/stopped. This is often used to save on cloud
224
218
costs or enforce ephemeral workflows. When a workspace is started or stopped,
225
- the Coder server runs an additional [ terraform
226
- apply] ( https://www.terraform.io/cli/commands/apply ) , informing the Coder
227
- provider that the workspace has a new transition state.
219
+ the Coder server runs an additional [ terraform apply] ( https://www.terraform.io/cli/commands/apply ) ,
220
+ informing the Coder provider that the workspace has a new transition state.
228
221
229
222
This template sample has one persistent resource (docker volume) and one
230
223
ephemeral resource (docker image).
@@ -351,13 +344,9 @@ users access to additional web applications.
351
344
### Data source
352
345
353
346
When a workspace is being started or stopped, the ` coder_workspace ` data source
354
- provides some useful parameters. See the [ documentation for the ` coder `
355
- Terraform
356
- provider] ( https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace )
357
- for more information.
347
+ provides some useful parameters. See the [ Coder Terraform provider] ( https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace ) for more information.
358
348
359
- For example, the [ Docker quick-start
360
- template] ( https://github.com/coder/coder/tree/main/examples/templates/docker )
349
+ For example, the [ Docker quick-start template] ( https://github.com/coder/coder/tree/main/examples/templates/docker )
361
350
sets a few environment variables based on the username and email address of the
362
351
workspace's owner, so that you can make Git commits immediately without any
363
352
manual configuration:
@@ -380,9 +369,8 @@ customize them however you like.
380
369
## Troubleshooting templates
381
370
382
371
Occasionally, you may run into scenarios where a workspace is created, but the
383
- agent is not connected. This means the agent or [ init
384
- script] ( https://github.com/coder/coder/tree/main/provisionersdk/scripts ) has
385
- failed on the resource.
372
+ agent is not connected. This means the agent or [ init script] ( https://github.com/coder/coder/tree/main/provisionersdk/scripts )
373
+ has failed on the resource.
386
374
387
375
``` console
388
376
$ coder ssh myworkspace
0 commit comments