1---2name: provider-docs3description: 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.4---5
6# Terraform Provider Docs
7
8## Follow This Workflow
9
101. Confirm scope and documentation targets.
11- Map code changes to the exact doc targets: provider index, resources, data sources, ephemeral resources, list resources, functions, actions, or guides.
12- Decide whether content should come from schema descriptions, templates, or both.
13
142. Write schema descriptions first.
15- Add precise user-facing descriptions to schema fields so generated docs stay aligned with behavior.
16- Keep wording specific to argument purpose, constraints, defaults, and computed behavior.
17
183. Add or update template files in `docs/`.
19- Create only files that map to implemented provider objects.
20- Use HashiCorp-recommended template paths:
21 - `docs/index.md.tmpl`
22 - `docs/data-sources/<name>.md.tmpl`
23 - `docs/resources/<name>.md.tmpl`
24 - `docs/ephemeral-resources/<name>.md.tmpl`
25 - `docs/list-resources/<name>.md.tmpl`
26 - `docs/functions/<name>.md.tmpl`
27 - `docs/actions/<name>.md.tmpl` (tfplugindocs generates action docs with Terraform v1.14.0+)
28 - `docs/guides/<name>.md.tmpl`
29- Keep templates focused on overview and examples; rely on generated sections for field-by-field details.
30- Keep HCL examples in the `examples/` directory — one example per file, pulled into templates with `tffile` — rather than inlined in templates (see Example File Conventions in `references/hashicorp-provider-docs.md`). Examples must not contain `terraform`, `provider`, or `output` blocks.
31- For action pages, follow the structure in `references/hashicorp-provider-docs.md` (Action Pages section): examples must show both the `action` block and the `action_trigger` lifecycle wiring, and actions get no attribute/output section.
32
334. Generate documentation with `tfplugindocs`.
34- Prefer repository defaults when configured:
35```bash
36go generate ./...
37```
38- Otherwise run the generator directly:
39```bash
40go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name <provider_name>
41```
42- Re-run generation after every schema or template edit.
43
445. Validate the generated markdown.
45- Verify files in `docs/` match the current provider implementation.
46- Verify examples are valid HCL and reflect current argument/attribute names.
47- Verify required/optional/computed semantics in docs match schema behavior.
48
496. Apply Registry publication rules before release.
50- Use semantic version tags prefixed with `v` (for example `v1.2.3`).
51- Create release tags from the default branch.
52- Keep `terraform-registry-manifest.json` in the repository root.
53- Expect docs to be versioned in Registry and switchable with the version selector.
54
557. Preview or troubleshoot publication when needed.
56- Use the HashiCorp preview process to inspect rendered docs before release when accuracy risk is high.
57- If docs are missing in Registry, check tag format, tag source branch, manifest file presence, and provider publication status.
58
59## Enforce Quality Bar
60
61- Keep documentation behaviorally accurate; never describe unsupported arguments or attributes.
62- Keep examples minimal, realistic, and runnable.
63- Keep terminology and naming consistent across provider, resources, and data sources.
64- Avoid duplicating generated argument/attribute blocks in manual templates.
65- Keep doc changes tied to the same PR as schema/API changes whenever possible.
66
67## Load References On Demand
68
69- Read `references/hashicorp-provider-docs.md` for source-backed rules and official links.
70- Load only the sections needed for the current change to keep context lean.