Terraform provider resources
Guides writing Terraform provider resources and data sources on the Plugin Framework: schema, CRUD, not-found handling, import, waiters for eventually consistent APIs and minimum tests. Use when adding, changing or reviewing a provider resource.
provider-resources- Author
- HashiCorp
- Source
- hashicorp/agent-skills/plugins/terraform/skills/provider-resources @ 5e30fa5
- License
- MPL-2.0
About this skill
What it does
The skill guides the agent through writing resources and data sources for a Terraform provider in Go. New code goes on the Plugin Framework only; SDKv2 is for maintaining existing resources, and go.mod shows which one a provider uses. Its resource template covers the client wiring in Configure, a schema with plan modifiers (RequiresReplace, UseStateForUnknown) and validators, and CRUD with fixed behaviour: Read drops the resource from state when the API says it is gone, Update calls the API only for changed attributes, Delete treats "already deleted" as success, Import passes the ID through. A shared finder keeps not-found handling identical everywhere. It also rules out a redundant id, wants docs generated by tfplugindocs and ends with a pre-submission checklist.
references/design-principles.md covers what should be a resource: the smallest object with its own CRUD, one API per resource, singular versus plural data sources. references/retries-and-waiters.md sorts eventual-consistency failures into three classes, each with its own fix: a short not-found retry right after create, a bounded retry on one typed error, and a status-plus-wait pair built on retry.StateChangeConf.
When to use it, and when not
Use it when adding or changing a resource or data source, deciding how to model an API object, or reviewing a resource before a pull request.
It is not for HCL that uses a provider. SDKv2 migration, the provider's own Configure, docs and running acceptance tests belong to other skills in HashiCorp's plugin (provider-framework-migration, provider-configuration, provider-docs, run-acceptance-tests) that our catalog does not list.
How to run it
We do not copy this skill: its files are under MPL-2.0, a file-level copyleft licence outside the set we copy under. Install it from HashiCorp's repository with the button to the source: one skill via npx skills add hashicorp/agent-skills/plugins/terraform/skills/provider-resources, or the whole terraform plugin, which brings those skills too, via claude plugin marketplace add hashicorp/agent-skills, then claude plugin install terraform@hashicorp. In Codex: codex plugin marketplace add hashicorp/agent-skills, then install terraform from /plugins and start a new session. In Claude Code, the plugin's skill may appear as /terraform:provider-resources.
- Claude Code:
/provider-resources, or ask for the skill by name. - Codex:
$provider-resources. - Cursor: type
/in the Agent chat and pickprovider-resources.
Example: /provider-resources Add an examplecloud_widget resource with import and a waiter from CREATING to ACTIVE.
How it differs from similar skills
Terraform provider test patterns is its testing half: this skill names the minimum tests (_basic with an import step, _disappears, one per attribute), then defers to that skill for state checks, plan checks, sweepers and ephemeral resources. Nothing else in the catalog covers writing Terraform providers.
Install
This skill is not copied to the catalog: its licence allows a copy only under the same licence, and the catalog does not copy under such licences. Install it from the author's repository.
Connect through AnyModel API
This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.
AnyModel