| page_title | coder_task Data Source - terraform-provider-coder |
|---|---|
| subcategory | |
| description | Use this data source to read information about Coder Tasks. ~> Deprecated: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Starting June 2, 2026, Coder Tasks moves to a 12-month Extended Support Release (ESR) for Premium customers. Templates no longer require AI task resources; use Coder Agents https://coder.com/docs/ai-coder/agents and follow the migration guide https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration. Coder Tasks documentation remains available in the v2.36 documentation https://coder.com/docs/@v2.36.3/ai-coder/tasks. |
Use this data source to read information about Coder Tasks.
~> Deprecated: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Starting June 2, 2026, Coder Tasks moves to a 12-month Extended Support Release (ESR) for Premium customers. Templates no longer require AI task resources; use Coder Agents and follow the migration guide. Coder Tasks documentation remains available in the v2.36 documentation.
provider "coder" {}
data "coder_workspace" "me" {}
data "coder_task" "me" {}
resource "coder_ai_task" "task" {
count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
app_id = module.example-agent.task_app_id
}
module "example-agent" {
count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
prompt = data.coder_task.me.prompt
}-
enabled(Boolean, Deprecated) True when executing in a Coder Task context, false when in a Coder Workspace context.-> The
enabledfield is only populated in Coder v2.28 and later. -
id(String) The UUID of the task, if executing in a Coder Task context. Empty in a Coder Workspace context. -
prompt(String, Deprecated) The prompt text provided to the task by Coder, if executing in a Coder Task context. Empty in a Coder Workspace context.-> The
promptfield is only populated in Coder v2.28 and later.