Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

terraform-infra

БесплатноЗапускает вложенные скриптыНе проверен

Terraform infrastructure operations with safety controls

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

Terraform Infrastructure Skill

Installation

The skill invokes the Terraform CLI. Install:

  • macOS: brew tap hashicorp/tap && brew install hashicorp/tap/terraform
  • Windows: choco install terraform or download from HashiCorp
  • Linux (apt): Add HashiCorp repo then sudo apt update && sudo apt install terraform (see HashiCorp install)

Verify: terraform --version

Cheat Sheet & Best Practices

Workflow: terraform init → terraform fmt → terraform validate → terraform plan -out=tfplan → review → terraform apply tfplan. Use terraform show tfplan to inspect.

Hacks: Always run plan before apply; never apply blind. Use remote state (e.g. S3 + lock) for team work. Prefer -auto-approve only in CI with reviewed plans. Use terraform state list and terraform state show <resource> to debug. Use service accounts / workload identity in pipelines; avoid static keys.

Certifications & Training

HashiCorp Terraform Associate (004): IaC concepts, Terraform fundamentals, state, modules, Terraform Cloud. Learning path. Skill data: init → fmt → validate → plan -out → apply; remote state; no blind apply.

Hooks & Workflows

Suggested hooks: Pre-apply: run terraform plan -out=tfplan and gate on review. CI: apply only after plan approval. Use with devops (primary).

Workflows: Use with devops (primary). Flow: init → plan → review → apply; use state commands for debugging. See ci-cd-implementation-rule for pipeline integration.

Overview

Provides 90%+ context savings vs raw Terraform MCP server. Includes critical safety controls for infrastructure operations.

Requirements

  • Terraform CLI (v1.0+)
  • Cloud provider credentials configured
  • Working directory with .tf files

Tools (Progressive Disclosure)

Planning & Validation

Tool Description Confirmation
plan Generate terraform plan No
validate Validate configuration No
fmt Format terraform files No

State Operations

Tool Description Confirmation
show Display current state No
list List state resources No
state-mv Move resource in state Yes

Workspace Operations

Tool Description Confirmation
workspace-list List workspaces No
workspace-select Select workspace No
workspace-new Create workspace Yes

Execution (⚠️ Dangerous)

Tool Description Confirmation
apply Apply changes REQUIRED

Blocked Operations

Tool Status
destroy BLOCKED
state-rm BLOCKED

Quick Reference

# Initialize
terraform init

# Plan changes
terraform plan -out=tfplan

# Validate
terraform validate

# Apply (requires -auto-approve for automation)
terraform apply tfplan

Configuration

  • Working directory: Must contain terraform files
  • TFVAR*: Variable values via environment
  • TF_WORKSPACE: Active workspace

Safety Controls

⚠️ terraform apply ALWAYS requires confirmation ⚠️ terraform destroy is BLOCKED by default ⚠️ State modifications require confirmation ⚠️ Review plan output before apply

Agent Integration

  • devops (primary): Infrastructure management
  • architect (secondary): Infrastructure design
  • cloud-integrator (secondary): Cloud provisioning

Troubleshooting

Issue Solution
Init failed Check provider credentials
State locked Check for other operations
Plan failed Review error output carefully

Module Development

Creating Reusable Modules

Structure modules following HashiCorp conventions:

modules/
  vpc/
    main.tf          # Resource definitions
    variables.tf     # Input variables
    outputs.tf       # Output values
    versions.tf      # Required provider versions
    README.md        # Module documentation

Module Best Practices

Practice Description
Single responsibility Each module manages one logical resource group
Typed variables Use type constraints on all variables
Validation blocks Add validation {} for input constraints
Sensitive outputs Mark secrets with sensitive = true
Полный SKILL.md на GitHub

Установить terraform-infra в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash
Read
Glob

Вложенные файлы

commands/terraform-infra.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/terraform-infra.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл terraform-infra?

Terraform infrastructure operations with safety controls

Как установить скилл terraform-infra?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл terraform-infra запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить terraform-infra с