File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ module "code-server" {
181
181
``` text
182
182
my-module/
183
183
├── main.tf # Terraform configuration
184
+ ├── run.sh # Installation/setup script (optional but recommended)
184
185
├── README.md # Documentation with frontmatter
185
186
└── main.test.ts # Test suite
186
187
```
@@ -212,8 +213,13 @@ variable "port" {
212
213
data "coder_workspace" "me" {}
213
214
214
215
resource "coder_script" "install" {
215
- agent_id = var.agent_id
216
- script = "#!/bin/bash\necho 'Installing service...'"
216
+ agent_id = var.agent_id
217
+ display_name = "Install Service"
218
+ icon = "/icon/service.svg"
219
+ script = templatefile("${path.module}/run.sh", {
220
+ PORT = var.port
221
+ })
222
+ run_on_start = true
217
223
}
218
224
219
225
resource "coder_app" "service" {
You can’t perform that action at this time.
0 commit comments