File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
examples/data-sources/coder_task Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,24 @@ description: |-
1010
1111Use this data source to read information about Coder tasks.
1212
13+ ## Example Usage
1314
15+ ``` terraform
16+ provider "coder" {}
17+
18+ data "coder_workspace" "me" {}
19+ data "coder_task" "me" {}
20+
21+ resource "coder_ai_task" "task" {
22+ count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
23+ app_id = module.example-agent.task_app_id
24+ }
25+
26+ module "example-agent" {
27+ count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
28+ prompt = data.coder_ai_task.me.prompt
29+ }
30+ ```
1431
1532<!-- schema generated by tfplugindocs -->
1633## Schema
Original file line number Diff line number Diff line change 1+ provider "coder" {}
2+
3+ data "coder_workspace" "me" {}
4+ data "coder_task" "me" {}
5+
6+ resource "coder_ai_task" "task" {
7+ count = data. coder_task . me . enabled ? data. coder_workspace . me . start_count : 0
8+ app_id = module. example-agent . task_app_id
9+ }
10+
11+ module "example-agent" {
12+ count = data. coder_task . me . enabled ? data. coder_workspace . me . start_count : 0
13+ prompt = data. coder_ai_task . me . prompt
14+ }
You can’t perform that action at this time.
0 commit comments