> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Terraform 提供商

> 使用官方 Terraform 提供商以基础架构即代码的方式管理 Devin 资源

官方 Devin Terraform 提供商可让你以基础架构即代码的方式管理 Devin 资源。该提供商支持 v3 API 资源，包括组织、Git 权限、playbooks、知识笔记、secrets、计划、IP 访问列表和 IdP 组角色映射。

```hcl theme={null}
terraform {
  required_providers {
    devin = {
      source = "registry.terraform.io/cognitionai/devin"
    }
  }
}

provider "devin" {
  # 默认从 DEVIN_TOKEN 环境变量中读取令牌。
}

resource "devin_knowledge_note" "conventions" {
  org_id  = "org-abc123"
  name    = "API Conventions"
  body    = file("knowledge/api-conventions.md")
  trigger = "When working on API endpoints"
}
```

提供商通过 `DEVIN_TOKEN` 环境变量使用服务用户凭据 (以 `cog_` 开头) 进行身份验证。有关如何获取此类凭据，请参阅[身份验证](/zh/api-reference/authentication)。

<div id="learn-more">
  ## 了解更多
</div>

<CardGroup cols={2}>
  <Card title="Terraform Registry" icon="cube" href="https://registry.terraform.io/providers/cognitionai/devin/latest/docs">
    提供商完整文档：配置、资源和数据源。
  </Card>

  <Card title="GitHub 代码仓库" icon="github" href="https://github.com/CognitionAI/terraform-provider-devin">
    提供商源代码。
  </Card>
</CardGroup>
