hashicorp/agent-skills

new-terraform-provider

Use this when scaffolding a new Terraform provider with the Plugin Framework: workspace layout, go module setup, provider server main.go, and a provider.go with schema and Configure.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/hashicorp/agent-skills --skill new-terraform-provider

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

To scaffold a new Terraform provider with Plugin Framework:

  1. If I am already in a Terraform provider workspace, then confirm that I want

to create a new workspace. If I do not want to create a new workspace, then skip all remaining steps.

  1. Create a new workspace root directory. The root directory name should be

prefixed with "terraform-provider-". Perform all subsequent steps in this new workspace.

  1. Initialize a new Go module.
  2. Run go get -u github.com/hashicorp/terraform-plugin-framework@latest.
  3. Write a main.go file that follows the example.
  4. Write an internal/provider/provider.go file that follows

the example. Rename the demo provider, the DEMO_* environment variables, and the authentication attributes to match the target API.

  1. Remove TODO comments from main.go and provider.go.
  2. Run go mod tidy
  3. Run go build -o /dev/null
  4. Run go test ./...

The scaffold resolves credentials as explicit config with environment variable fallback. To grow that into a full credential provider chain (shared credentials files, profiles, platform identity, configure-time validation), use the provider-configuration skill (if available). To add the first resource or data source, use the provider-resources skill (if available).

来自同一仓库

更多 Skills

全部 Skills
hashicorp
官方

terraform-style-guide

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

1小时安装量
2
GitHub Stars
936
最近更新
11月4日
hashicorp
官方

terraform-test

Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.

1小时安装量
2
GitHub Stars
936
最近更新
11月4日
hashicorp
官方

provider-docs

Create, update, and review Terraform provider documentation for Terraform Registry using HashiCorp-recommended patterns, tfplugindocs templates, and schema descriptions. Use when adding or changing provider configuration, resources, data sources, ephemeral resources, list resources, functions, actions, or guides; when validating generated docs; and when troubleshooting missing or incorrect Registry documentation.

1小时安装量
1
GitHub Stars
922
最近更新
11月4日
hashicorp
官方

provider-resources

Implement Terraform Provider resources and data sources using the Plugin Framework: CRUD operations, schema design, plan modifiers and validators, not-found handling, waiters for eventually consistent APIs, import support, resource design principles, and required acceptance test coverage. Use when adding or changing a resource or data source, deciding whether an API concept should be a resource, wiring a resource to the provider's configured client, handling drift or resource-not-found, or revie

1小时安装量
1
GitHub Stars
922
最近更新
11月4日