Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab89f40

Browse files
docs(modules): update contributing guide with prerequisites and enhanced resource links for better clarity
addressed all comments up to commit time aside from unresolved comments awaiting replies
1 parent 2c06040 commit ab89f40

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

docs/about/contributing/modules.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Coder modules
22

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.
415

516
## Architecture Overview
617

@@ -80,12 +91,11 @@ flowchart LR
8091
1. **Module Registry**: External registry hosts reusable modules and starter templates
8192
- Modules are Terraform configurations using Coder-specific resources
8293
- 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.
8495

85-
2. **Template Development**: Your Coder templates reference modules from the registry
96+
2. **Templates**: Your Coder templates reference modules from the registry
8697
- Use starter templates as infrastructure-specific starting points for your own templates
8798
- Reference individual modules to add functionality to your templates
88-
- Modules add `coder_script`, `coder_app`, and `coder_env` resources to templates
8999

90100
3. **Workspace Execution**: When workspaces are created, modules run through the Coder agent
91101
- **Scripts** install and configure tools (IDEs, languages, services)
@@ -186,7 +196,7 @@ module-name/
186196
├── main.tf # Terraform configuration with Coder resources
187197
├── main.test.ts # Test suite
188198
├── README.md # Documentation with frontmatter
189-
└── run.sh # Installation script
199+
└── run.sh # Installation or setup script
190200
```
191201

192202
### File Purposes
@@ -200,9 +210,9 @@ module-name/
200210

201211
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.
202212

203-
### Coder Resources
213+
### [Coder Resources](https://registry.terraform.io/providers/coder/coder/latest/docs)
204214

205-
#### coder_script - Command Execution
215+
#### [coder_script - Command Execution](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script)
206216

207217
Execute commands during workspace lifecycle events. This is the primary mechanism for software installation, service configuration, and environment setup.
208218

@@ -237,7 +247,7 @@ resource "coder_script" "install" {
237247
}
238248
```
239249

240-
#### coder_app - User Interface
250+
#### [coder_app - User Interface](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app)
241251

242252
Create accessible applications in the Coder workspace interface, providing users with one-click access to tools and services.
243253

@@ -251,7 +261,9 @@ Create accessible applications in the Coder workspace interface, providing users
251261

252262
- `agent_id`: The Coder agent
253263
- `external`: `true` for protocol handlers, `false` for web apps
264+
- `group`: Name of a group that this app belongs to.
254265
- `healthcheck`: Monitor service availability
266+
- `order`: Control the display order of apps in the dashboard
255267
- `subdomain`: Access method for web apps
256268
- `url`: Service URL or protocol handler
257269

@@ -264,14 +276,16 @@ resource "coder_app" "service" {
264276
url = "http://localhost:${var.port}"
265277
266278
healthcheck {
267-
url = "http://localhost:${var.port}/health"
279+
url = "http://localhost:${var.port}/api/status" # Service-specific endpoint
268280
interval = 5
269281
threshold = 6
270282
}
271283
}
272284
```
273285

274-
#### coder_env - Environment Variables
286+
> **⚠️ 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.
287+
288+
#### [coder_env - Environment Variables](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/env)
275289

276290
Set environment variables in workspace sessions for tool configuration and authentication.
277291

0 commit comments

Comments
 (0)