Terraform Resources for Dev Containers
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- terraform
研究方向
首先追蹤 coder_devcontainer 資源,以及它與 coder_app、coder_script、coder_env 和 coder_ai_task 的互動;接著檢視 devcontainer.json 中的 customizations.coder.modules 自訂項目,以及 coderd 的 coder/preview 路徑。此 issue 描述了兩個階段,因此請在實作前確認預期範圍與驗收標準;完成後應包含指定的資源關聯與模組佈建行為。
由索引模型根據 Issue 內容生成。
描述
Epic: Terraform Resources for Dev Containers
Summary
Enable template authors to attach Terraform resources (coder_app, coder_script, coder_env, coder_ai_task) to coder_devcontainer resources, eliminating the need to choose between Dev Containers and our collection of Terraform modules.
Problem Statement
Opting in to Dev Containers requires opting out of our collection of Terraform modules as there is no way of associating terraform resources to the coder_devcontainer resource.
Agents used for Dev Containers are created dynamically after workspace provisioning. Since the sub-agent doesn't exist at Terraform plan/apply time, there is no way to reference it in Terraform.
Solution Overview
Phase 1: Terraform-defined Resources
Introduce a computed subagent_id field on the coder_devcontainer resource that can be referenced by other Terraform resources. This ID is pre-computed at plan time and used when the sub-agent is created at runtime.
resource "coder_devcontainer" "main" {
agent_id = coder_agent.main.id
workspace_folder = "/workspaces/project"
}
resource "coder_app" "code_server" {
agent_id = coder_devcontainer.main.subagent_id
slug = "code-server"
display_name = "VS Code"
url = "http://localhost:8080"
}
Phase 2: devcontainer.json-defined Resources
Enable Terraform modules to be defined directly in devcontainer.json via customizations.coder.modules, allowing developers to attach modules to their dev container without modifying Terraform templates. The modules are provisioned by coderd using coder/preview.
{
"customizations": {
"coder": {
"modules": {
"registry.coder.com/coder/code-server/coder:1.0.0": {},
"registry.coder.com/coder/zed/coder:1": {
"folder": "/home/coder/coder"
}
}
}
}
}
The key format is <registry link>:<version> and the value is an object of key-value mappings where each key is translated into a Terraform variable.
- 主要語言
- 沒有語言資料
- 星號
- 3
- 分支
- 0
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
coder/internal 的其他 Issue
-
flake
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 4/5 3-5 天 新手友好度 45/100
-
flake
-
flake
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 80/100
-
難度 2/5 1-3 小時 新手友好度 70/100
-
oblt-aw/detector/security
難度 2/5 1-3 小時 新手友好度 65/100
-
難度 2/5 1-3 小時 新手友好度 75/100
trailofbits/skills#330 ·
-
Bug kind/engineering pulumi/pulumi-external Workflow Failure
難度 2/5 1-3 小時 新手友好度 65/100
pulumi/pulumi-external#733 ·