Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c250e3

Browse files
committed
fix(examples/templates): update tasks-docker template to support provider version 2.12.0
1 parentb3f651d commit8c250e3

File tree

1 file changed

+23
-18
lines changed
  • examples/templates/tasks-docker

1 file changed

+23
-18
lines changed

‎examples/templates/tasks-docker/main.tf‎

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
terraform {
22
required_providers {
33
coder={
4-
source="coder/coder"
4+
source="coder/coder"
5+
version=">= 2.13"
56
}
67
docker={
78
source="kreuzwerker/docker"
@@ -12,22 +13,33 @@ terraform {
1213
# This template requires a valid Docker socket
1314
# However, you can reference our Kubernetes/VM
1415
# example templates and adapt the Claude Code module
15-
#
16-
# see: https://registry.coder.com/templates
16+
#
17+
# see: https://registry.coder.com/templates
1718
provider"docker" {}
1819

20+
# A Coder Task resource stores the prompt sent to the task
21+
# and enables us to store the coder_workspace_app associated
22+
# with the task.
23+
resource"coder_ai_task""task" {
24+
count=data.coder_workspace.me.start_count
25+
app_id=module.claude-code[count.index].task_app_id
26+
}
27+
28+
# You can read the task prompt from the `coder_task` data source.
29+
data"coder_task""me" {}
30+
1931
# The Claude Code module does the automatic task reporting
2032
# Other agent modules: https://registry.coder.com/modules?search=agent
21-
# Or use a custom agent:
33+
# Or use a custom agent:
2234
module"claude-code" {
2335
count=data.coder_workspace.me.start_count
2436
source="registry.coder.com/coder/claude-code/coder"
25-
version="3.4.4"
37+
version="4.0.0"
2638
agent_id=coder_agent.main.id
2739
workdir="/home/coder/projects"
2840
order=999
2941
claude_api_key=""
30-
ai_prompt=data.coder_parameter.ai_prompt.value
42+
ai_prompt=data.coder_task.me.prompt
3143
system_prompt=data.coder_parameter.system_prompt.value
3244
model="sonnet"
3345
permission_mode="plan"
@@ -51,13 +63,13 @@ data "coder_workspace_preset" "default" {
5163
(servers, dev watchers, GUI apps).
5264
-Built-in tools - use for everything else:
5365
(file operations, git commands, builds & installs, one-off shell commands)
54-
66+
5567
Remember this decision rule:
5668
- Stays running? → desktop-commander
5769
- Finishes immediately? → built-in tools
58-
70+
5971
-- Context --
60-
There is an existing app and tmux dev server running on port 8000. Be sure to read it's CLAUDE.md (./realworld-django-rest-framework-angular/CLAUDE.md) to learn more about it.
72+
There is an existing app and tmux dev server running on port 8000. Be sure to read it's CLAUDE.md (./realworld-django-rest-framework-angular/CLAUDE.md) to learn more about it.
6173
6274
Since this app is for demo purposes and the user is previewing the homepage and subsequent pages, aim to make the first visual change/prototype very quickly so the user can preview it, then focus on backend or logic which can be a more involved, long-running architecture plan.
6375
@@ -107,7 +119,7 @@ data "coder_workspace_preset" "default" {
107119

108120
# Pre-builds is a Coder Premium
109121
# feature to speed up workspace creation
110-
#
122+
#
111123
# see https://coder.com/docs/admin/templates/extending-templates/prebuilt-workspaces
112124
# prebuilds {
113125
# instances = 1
@@ -126,13 +138,6 @@ data "coder_parameter" "system_prompt" {
126138
description="System prompt for the agent with generalized instructions"
127139
mutable=false
128140
}
129-
data"coder_parameter""ai_prompt" {
130-
type="string"
131-
name="AI Prompt"
132-
default=""
133-
description="Write a prompt for Claude Code"
134-
mutable=true
135-
}
136141
data"coder_parameter""setup_script" {
137142
name="setup_script"
138143
display_name="Setup Script"
@@ -373,4 +378,4 @@ resource "docker_container" "workspace" {
373378
label="coder.workspace_name"
374379
value=data.coder_workspace.me.name
375380
}
376-
}
381+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp