provider-docs

โดย hashicorp

สร้าง อัปเดต และตรวจสอบเอกสารประกอบของ Terraform provider สำหรับ Terraform Registry โดยใช้รูปแบบที่ HashiCorp แนะนำ เทมเพลต tfplugindocs และ schema…

npx skills add https://github.com/hashicorp/agent-skills --skill provider-docs

Terraform Provider Docs

Follow This Workflow

  1. Confirm scope and documentation targets.
  • Map code changes to the exact doc targets: provider index, resources, data sources, ephemeral resources, list resources, functions, actions, or guides.
  • Decide whether content should come from schema descriptions, templates, or both.
  1. Write schema descriptions first.
  • Add precise user-facing descriptions to schema fields so generated docs stay aligned with behavior.
  • Keep wording specific to argument purpose, constraints, defaults, and computed behavior.
  1. Add or update template files in docs/.
  • Create only files that map to implemented provider objects.
  • Use HashiCorp-recommended template paths:
    • docs/index.md.tmpl
    • docs/data-sources/<name>.md.tmpl
    • docs/resources/<name>.md.tmpl
    • docs/ephemeral-resources/<name>.md.tmpl
    • docs/list-resources/<name>.md.tmpl
    • docs/functions/<name>.md.tmpl
    • docs/actions/<name>.md.tmpl (tfplugindocs generates action docs with Terraform v1.14.0+)
    • docs/guides/<name>.md.tmpl
  • Keep templates focused on overview and examples; rely on generated sections for field-by-field details.
  • 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.
  • 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.
  1. Generate documentation with tfplugindocs.
  • Prefer repository defaults when configured:
go generate ./...
  • Otherwise run the generator directly:
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name <provider_name>
  • Re-run generation after every schema or template edit.
  1. Validate the generated markdown.
  • Verify files in docs/ match the current provider implementation.
  • Verify examples are valid HCL and reflect current argument/attribute names.
  • Verify required/optional/computed semantics in docs match schema behavior.
  1. Apply Registry publication rules before release.
  • Use semantic version tags prefixed with v (for example v1.2.3).
  • Create release tags from the default branch.
  • Keep terraform-registry-manifest.json in the repository root.
  • Expect docs to be versioned in Registry and switchable with the version selector.
  1. Preview or troubleshoot publication when needed.
  • Use the HashiCorp preview process to inspect rendered docs before release when accuracy risk is high.
  • If docs are missing in Registry, check tag format, tag source branch, manifest file presence, and provider publication status.

Enforce Quality Bar

  • Keep documentation behaviorally accurate; never describe unsupported arguments or attributes.
  • Keep examples minimal, realistic, and runnable.
  • Keep terminology and naming consistent across provider, resources, and data sources.
  • Avoid duplicating generated argument/attribute blocks in manual templates.
  • Keep doc changes tied to the same PR as schema/API changes whenever possible.

Load References On Demand

  • Read references/hashicorp-provider-docs.md for source-backed rules and official links.
  • Load only the sections needed for the current change to keep context lean.

Skills เพิ่มเติมจาก hashicorp

provider-actions
hashicorp
Implement การทำงานของ Terraform Provider โดยใช้ Plugin Framework ใช้เมื่อพัฒนาการดำเนินการแบบ imperative ที่ทำงานในเหตุการณ์ lifecycle (ก่อน/หลัง…
official
new-terraform-provider
hashicorp
ใช้สิ่งนี้เมื่อสร้าง Terraform provider ใหม่ด้วย Plugin Framework: โครงสร้าง workspace, การตั้งค่า go module, provider server main.go และ provider.go…
official
terraform-test
hashicorp
คู่มือที่ครอบคลุมสำหรับการเขียนและรันการทดสอบ Terraform ใช้เมื่อสร้างไฟล์ทดสอบ (.tftest.hcl) เขียนสถานการณ์ทดสอบด้วย run blocks ตรวจสอบความถูกต้อง…
official
terraform-test
hashicorp
คู่มือที่ครอบคลุมสำหรับการเขียนและรันการทดสอบ Terraform พร้อมการยืนยันผล การจำลอง และการตรวจสอบโมดูล เขียนไฟล์ทดสอบโดยใช้ไวยากรณ์ .tftest.hcl พร้อมบล็อก run ที่ทำงานในโหมด plan หรือ apply รองรับการทำงานแบบลำดับและแบบขนานพร้อมการแยกสถานะที่เป็นทางเลือก ยืนยันเงื่อนไขบนแอตทริบิวต์ของทรัพยากร เอาต์พุต และแหล่งข้อมูล ใช้ expect_failures เพื่อตรวจสอบว่าอินพุตที่ไม่ถูกต้องถูกปฏิเสธอย่างเหมาะสม จำลองผู้ให้บริการ (Terraform 1.7.0+) เพื่อจำลองพฤติกรรมของโครงสร้างพื้นฐานโดยไม่ต้อง...
official
provider-actions
hashicorp
ใช้การดำเนินการของ Terraform Provider แบบ Imperative ในเหตุการณ์วงจรชีวิตของทรัพยากรโดยใช้ Plugin Framework รองรับทริกเกอร์วงจรชีวิตก่อน/หลังการสร้างและก่อน/หลังการอัปเดต (เหตุการณ์การทำลายไม่พร้อมใช้งานใน Terraform 1.14.0) ต้องมีการกำหนดสคีมาที่ถูกต้องพร้อมประเภทเฟรมเวิร์กที่เหมาะสม ElementType สำหรับคอลเล็กชัน และตัวตรวจสอบสำหรับการตรวจสอบอินพุต รวมถึงการรายงานความคืบหน้า การจัดการหมดเวลา และการจัดการข้อผิดพลาดที่ครอบคลุมสำหรับการดำเนินการที่ใช้เวลานาน รองรับการโพลและ...
official
aws-ami-builder
hashicorp
สร้าง Amazon Machine Images แบบกำหนดเองด้วย builder amazon-ebs ของ Packer อัตโนมัติการสร้าง AMI จาก AMI ต้นทางโดยใช้เทมเพลต HCL พร้อม provisioners สำหรับการปรับแต่ง (สคริปต์เชลล์, อัปโหลดไฟล์, การจัดการการกำหนดค่า) รองรับการกระจาย AMI หลายภูมิภาคผ่าน ami_regions และการกรอง AMI ต้นทางแบบยืดหยุ่นตามชื่อ, เจ้าของ, และประเภทการจำลองเสมือน ยืนยันตัวตนผ่านตัวแปรสภาพแวดล้อม, ไฟล์ข้อมูลรับรอง AWS, หรือโปรไฟล์อินสแตนซ์ IAM; รวมคำสั่งตรวจสอบและสร้างสำหรับเทมเพลต...
official
new-terraform-provider
hashicorp
สร้างโครงร่างผู้ให้บริการ Terraform ใหม่โดยใช้ Plugin Framework สร้างพื้นที่ทำงานโมดูล Go ใหม่ตามรูปแบบการตั้งชื่อมาตรฐาน "terraform-provider-" และเริ่มต้นการพึ่งพาที่จำเป็น ให้ไฟล์ main.go ต้นแบบตามรูปแบบ Plugin Framework ของ HashiCorp พร้อมเครื่องหมาย TODO สำหรับการปรับแต่ง ตรวจสอบการตั้งค่าโดยรันคำสั่ง build และ test เพื่อให้แน่ใจว่าผู้ให้บริการคอมไพล์และผ่านการตรวจสอบเบื้องต้น จัดการพื้นที่ทำงานโดยยืนยันความตั้งใจก่อนสร้างใหม่...
official
azure-verified-modules
hashicorp
ข้อกำหนดการรับรองและแนวปฏิบัติที่ดีที่สุดสำหรับโมดูล Azure Terraform ที่ต้องการความสอดคล้องกับ AVM บังคับใช้ข้อจำกัดเวอร์ชันของ provider (azurerm >= 4.0, < 5.0; azapi >= 2.0, < 3.0) และห้ามการอ้างอิงโมดูลแบบ git โดยกำหนดให้ใช้แหล่งที่มาจาก Terraform registry ที่ถูกตรึงไว้ กำหนดให้ใช้ snake_casing ตัวพิมพ์เล็กสำหรับ identifiers ทั้งหมด ชนิดตัวแปรที่แม่นยำ แอตทริบิวต์เอาต์พุตแบบแยกส่วนผ่านรูปแบบ anti-corruption layer และ locals ที่เรียงตามลำดับตัวอักษร กำหนดให้มีตัวแปรสลับฟีเจอร์สำหรับทรัพยากรใหม่ที่ถูกเพิ่ม...
official