terraform-provider-coder icon indicating copy to clipboard operation
terraform-provider-coder copied to clipboard

Add `coder_script` parameter for `script_args`

Open djarbz opened this issue 1 month ago • 0 comments

I recently pushed the copyparty module to the registry and while creating it, I found that I had to template some CLI args that I really just needed to pass onto a final binary process.

In my case, I was populating an array of arguments, and actually created a bug in my module based on how they were being passed and parsed.

It would be nice to add an arguments parameter for things that just need to be passed on to the next process similar to defining the CMD parameter for a container.

resource "coder_script" "code-server" {
  agent_id           = coder_agent.dev.id
  display_name       = "code-server"
  icon               = "/icon/code.svg"
  run_on_start       = true
  start_blocks_login = true
  script = templatefile("./install-code-server.sh", {
    LOG_PATH : "/tmp/code-server.log"
  })
  script_arguments = [
    "Arg1",
    "Arg2",
    "Arg3",
  ]
}

Then in my script I could have the following:

mybin "${@}"

djarbz avatar Oct 29 '25 17:10 djarbz