Skip to content

Add coder_agent_script resource for running parallel startup tasks #9287

Closed
@kylecarbs

Description

@kylecarbs

We do not have much modularity in our templates right now. There's no way to add new features to your template without just copying another template. This proposes we add a coder_agent_script resource that allows for parallel operations on start in a self-contained module.

resource "coder_agent_script" "code-server" {
    agent_id = coder_agent.dev.id
    name = "code-server"
    icon = "/icons/code.svg"
    script = <<EOF
        curl -fsSL https://code-server.dev/install.sh | sh
    EOF
}

We should add a lifecycle to this, but default to execute on start. This would run and appear in the logs UI in tabs for each script:

image

This allows us to provide aspects of the startup script as Terraform Modules. Enabling customers to add features to their workspaces:

module "code-server" {
  source  = "coder/code-server"
  version = "1.73.0"
  extensions = [
    // list extensions to be automatically installed on start
  ]
}

A module could provide parameters as well, enabling entirely self-contained modules that mutate an agent.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions