Command Palette

Search for a command to run...

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

terraform-generator

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

Create, generate, write, or scaffold Terraform .tf HCL — resources, modules, providers, variables, outputs.

akin-ozerот akin-ozer★ 346 звёзд на GitHub

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

Terraform Generator

Overview

This skill enables the generation of production-ready Terraform configurations following best practices and current standards. Automatically integrates validation and documentation lookup for custom providers and modules.

Critical Requirements Checklist

STOP: You MUST complete ALL steps in order. Do NOT skip any REQUIRED step.

Step Action Required
1 Understand requirements (providers, resources, modules) ✅ REQUIRED
2 Check for custom providers/modules and lookup documentation ✅ REQUIRED
3 Consult reference files before generation ✅ REQUIRED
4 Generate Terraform files with ALL best practices ✅ REQUIRED
5 Include data sources for dynamic values (region, account, AMIs) ✅ REQUIRED
6 Add lifecycle rules on critical resources (KMS, databases) ✅ REQUIRED
7 Invoke Skill(devops-skills:terraform-validator) ✅ REQUIRED
8 FIX all validation/security failures and RE-VALIDATE ✅ REQUIRED
9 Provide usage instructions (files, next steps, security) ✅ REQUIRED

IMPORTANT: If validation fails (terraform validate OR security scan), you MUST fix the issues and re-run validation until ALL checks pass. Do NOT proceed to Step 9 with failing checks.

Core Workflow

When generating Terraform configurations, follow this workflow:

Step 1: Understand Requirements

Analyze the user's request to determine:

  • What infrastructure resources need to be created
  • Which Terraform providers are required (AWS, Azure, GCP, custom, etc.)
  • Whether any modules are being used (official, community, or custom)
  • Version constraints for providers and modules
  • Variable inputs and outputs needed
  • State backend configuration (local, S3, remote, etc.)

Step 2: Check for Custom Providers/Modules

Before generating configurations, identify if custom or third-party providers/modules are involved:

Standard providers (no lookup needed):

  • hashicorp/aws
  • hashicorp/azurerm
  • hashicorp/google
  • hashicorp/kubernetes
  • Other official HashiCorp providers

Custom/third-party providers/modules (require documentation lookup):

  • Third-party providers (e.g., datadog/datadog, mongodb/mongodbatlas)
  • Custom modules from Terraform Registry
  • Private or company-specific modules
  • Community modules

When custom providers/modules are detected:

  1. Use WebSearch to find version-specific documentation:

    Search query format: "[provider/module name] terraform [version] documentation [specific resource]"
    Example: "datadog terraform provider v3.30 monitor resource documentation"
    Example: "terraform-aws-modules vpc version 5.0 documentation"
    
  2. Focus searches on:

    • Official documentation (registry.terraform.io, provider websites)
    • Required and optional arguments
    • Attribute references
    • Example usage
    • Version compatibility notes
  3. If Context7 MCP is available and the provider/module is supported, use it as an alternative:

    mcp__context7__resolve-library-id → mcp__context7__query-docs
    

Step 2.5: Consult Reference Files (REQUIRED)

Before generating configuration, you MUST consult reference files using this matrix:

Reference Requirement Read When
terraform_best_practices.md REQUIRED Always - contains baseline required patterns
provider_examples.md REQUIRED Any AWS, Azure, GCP, or Kubernetes resource generation
common_patterns.md OPTIONAL by default, REQUIRED for complex requests Multi-environment, workspace, composition, DR, or conditional patterns

Open references by path:

devops-skills-plugin/skills/terraform-generator/references/terraform_best_practices.md
devops-skills-plugin/skills/terraform-generator/references/provider_examples.md
devops-skills-plugin/skills/terraform-generator/references/common_patterns.md

Step 3: Generate Terraform Configuration

Generate HCL files following best practices:

File Organization:

terraform-project/
├── main.tf           # Primary resource definitions
├── variables.tf      # Input variable declarations
├── outputs.tf        # Output value declarations
├── versions.tf       # Provider version constraints
├── terraform.tfvars  # Variable values (optional, for examples)
└── backend.tf        # Backend configuration (optional)

Best Practices to Follow:

  1. Provider Configuration:

    terraform {
      required_version = ">= 1.10, < 2.0"
    
      required_providers {
        aws = {
          source  = "hashicorp/aws"
          version = "~> 6.0"  # Major pin; verify exact current version when needed
        }
      }
    }
    
    provider "aws" {
      region = var.aws_region
    }
    
  2. Resource Naming:

    • Use descriptive resource names
    • Follow snake_case convention
    • Include resource type in name when helpful
    resource "aws_instance" "web_server" {
      # ...
    }
    
Полный SKILL.md на GitHub

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

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

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

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

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

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

Без ограничений — скилл может использовать любой инструмент.

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

assets/README.mdassets/minimal-project/README.mdassets/minimal-project/main.tfassets/minimal-project/outputs.tfassets/minimal-project/terraform.tfvars.exampleassets/minimal-project/variables.tfassets/minimal-project/versions.tfreferences/common_patterns.mdreferences/provider_examples.mdreferences/terraform_best_practices.mdscripts/check_feature_version_consistency.shscripts/run_ci_checks.sh

FAQ

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

Create, generate, write, or scaffold Terraform .tf HCL — resources, modules, providers, variables, outputs.

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

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

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

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

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

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