You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/about/contributing/modules.md
+24-10Lines changed: 24 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,17 @@
1
1
# Coder modules
2
2
3
-
Coder modules are reusable Terraform configurations that extend workspace functionality through the Coder Terraform provider. This guide focuses on understanding and creating effective modules.
3
+
Coder modules are reusable [Terraform configurations](https://developer.hashicorp.com/terraform/language) that extend workspace functionality through the Coder Terraform provider. This guide focuses on understanding and creating effective modules.
4
+
5
+
## Prerequisites
6
+
7
+
This guide assumes basic familiarity with Terraform concepts. If you're new to Terraform, we recommend reviewing these resources first:
8
+
9
+
-**[What is Terraform?](https://developer.hashicorp.com/terraform/intro)** - Introduction to infrastructure as code
10
+
-**[Terraform Configuration Language](https://developer.hashicorp.com/terraform/language)** - Learn the HCL syntax used in `.tf` files
11
+
-**[Terraform Variables](https://developer.hashicorp.com/terraform/language/values/variables)** - Understanding input variables and configuration
12
+
-**[Terraform Modules](https://developer.hashicorp.com/terraform/language/modules)** - How modules work and module structure
13
+
14
+
For hands-on learning, try the [Terraform tutorials](https://developer.hashicorp.com/terraform/tutorials) to get comfortable with basic concepts before creating Coder modules.
4
15
5
16
## Architecture Overview
6
17
@@ -80,12 +91,11 @@ flowchart LR
80
91
1.**Module Registry**: External registry hosts reusable modules and starter templates
81
92
- Modules are Terraform configurations using Coder-specific resources
82
93
- Starter templates provide infrastructure-specific bases (Docker, AWS, GCP, etc.) to start building your own templates
83
-
-Community and official modules available at [registry.coder.com](https://registry.coder.com)
94
+
-[Coder registry](https://registry.coder.com) hosts a collection of official, partner, and community contributed templates and modules.
84
95
85
-
2.**Template Development**: Your Coder templates reference modules from the registry
96
+
2.**Templates**: Your Coder templates reference modules from the registry
86
97
- Use starter templates as infrastructure-specific starting points for your own templates
87
98
- Reference individual modules to add functionality to your templates
88
-
- Modules add `coder_script`, `coder_app`, and `coder_env` resources to templates
89
99
90
100
3.**Workspace Execution**: When workspaces are created, modules run through the Coder agent
91
101
-**Scripts** install and configure tools (IDEs, languages, services)
@@ -186,7 +196,7 @@ module-name/
186
196
├── main.tf # Terraform configuration with Coder resources
187
197
├── main.test.ts # Test suite
188
198
├── README.md # Documentation with frontmatter
189
-
└── run.sh # Installation script
199
+
└── run.sh # Installation or setup script
190
200
```
191
201
192
202
### File Purposes
@@ -200,9 +210,9 @@ module-name/
200
210
201
211
The Coder Terraform provider offers several resource types for different aspects of workspace functionality. Understanding when and how to use each resource is crucial for effective module development.
Execute commands during workspace lifecycle events. This is the primary mechanism for software installation, service configuration, and environment setup.
> **⚠️ Important**: Health check URLs are service-specific. Common paths include `/health`, `/healthz`, `/ping`, `/status`, or `/api/health`. Check your service's documentation or use the main service URL if no dedicated health endpoint exists.
0 commit comments