界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
设计与创意 · SKILL.md

terraform

terraform

【设计与创意】Terraform infrastructure-as-code skills from HashiCorp. Covers HCL code generation with style conventions, testing with .tftest.hcl files, and module refactoring. Use when writing, reviewing, generating, or refactoring Terraform configurations, creating tests, or designing modules.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: terraform description: Terraform infrastructure-as-code skills from HashiCorp. Covers HCL code generation with style conventions, testing with .tftest.hcl files, and module refactoring. Use when writing, reviewing, generating, or refactoring Terraform configurations, creating tests, or designing modules. metadata: author: HashiCorp source: https://github.com/hashicorp/agent-skills version: "1.0"

Terraform Skills

HashiCorp's official Terraform agent skills for infrastructure-as-code development.

Available Sub-Skills

SkillFileUse When
Style Guideterraform-style-guide-SKILL.mdWriting or reviewing Terraform HCL code
Testingterraform-test-SKILL.mdCreating .tftest.hcl test files, writing assertions, mocking
Module Refactoringrefactor-module-SKILL.mdTransforming monolithic configs into reusable modules

Quick Reference

File Organization

FilePurpose
terraform.tfVersion requirements
providers.tfProvider configurations
main.tfPrimary resources
variables.tfInput variables (alphabetical)
outputs.tfOutput values (alphabetical)
locals.tfLocal values

Key Conventions

  • Two spaces per indent, no tabs
  • Lowercase with underscores for names
  • Every variable needs type and description
  • Every output needs description
  • Prefer for_each over count
  • Never hardcode credentials

Validation

terraform fmt -recursive
terraform validate

Source

From hashicorp/agent-skills - terraform code-generation and module-generation plugins.

我的收藏