Command Palette

Search for a command to run...

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

terraform

БесплатноБез исполняемых скриптовНе проверен

HashiCorp Terraform Infrastructure as Code (IaC) tool for provisioning, managing, and versioning cloud infrastructure

enunoот enuno★ 17 звёзд на GitHub16 установок в других каталогах

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

Terraform Infrastructure as Code Skill

Comprehensive assistance with HashiCorp Terraform for infrastructure provisioning, configuration management, and infrastructure lifecycle automation across cloud providers and on-premises environments.

When to Use This Skill

Explicit Triggers:

  • When user says "create terraform configuration", "write terraform code", or "terraform plan/apply"
  • When working with .tf, .tfvars, or .tfstate files
  • When managing cloud resources (AWS, Azure, GCP, Kubernetes, etc.) declaratively
  • When discussing infrastructure state management, modules, or providers
  • When importing existing infrastructure or migrating to Terraform
  • When debugging Terraform errors, state drift, or dependency issues

Context Indicators:

  • Mentions of resource, data, module, provider, variable, output blocks
  • Infrastructure provisioning workflows (create, update, destroy)
  • State management operations (state list, state show, state mv, state rm)
  • Module development or registry usage
  • Multi-environment infrastructure (dev, staging, production)

When NOT to Use This Skill

  • When writing CloudFormation, Pulumi, or other IaC tools (different syntax/semantics)
  • When managing Kubernetes manifests directly (use kubectl or Helm skills)
  • When writing Ansible playbooks (configuration management, not IaC)
  • When using Terraform Cloud/Enterprise (platform-specific features)
  • When working with Terraform CDK (TypeScript/Python abstraction layer)

Prerequisites

Knowledge Requirements

  • Understanding of target infrastructure platform (AWS, Azure, GCP, etc.)
  • Basic networking concepts (VPC, subnets, security groups, load balancers)
  • Resource dependencies and lifecycle management
  • State management and locking concepts

Environment Setup

  • Terraform CLI installed (terraform version ≥ 1.0)
  • Cloud provider credentials configured (AWS CLI, Azure CLI, gcloud, etc.)
  • Backend configured for state storage (S3, Azure Storage, Terraform Cloud)
  • Version control system (Git) for .tf files

Project Structure

terraform-project/
├── main.tf              # Primary resource definitions
├── variables.tf         # Input variable declarations
├── outputs.tf           # Output value definitions
├── terraform.tfvars     # Variable values (gitignored if sensitive)
├── versions.tf          # Terraform and provider version constraints
├── backend.tf           # State backend configuration
└── modules/             # Reusable module definitions
    └── networking/
        ├── main.tf
        ├── variables.tf
        └── outputs.tf

Core Terraform Workflow

Step 1: Initialize Terraform

# Download providers and initialize backend
terraform init

# Reinitialize if backend config changes
terraform init -reconfigure

# Upgrade providers to latest versions
terraform init -upgrade

What happens:

  • Downloads provider plugins (AWS, Azure, GCP, etc.)
  • Initializes backend for state storage
  • Creates .terraform/ directory and lock file

Step 2: Write Configuration

Resource Block (creates infrastructure):

resource "aws_instance" "web_server" {
  ami           = var.ami_id
  instance_type = var.instance_type

  tags = {
    Name        = "web-server-${var.environment}"
    Environment = var.environment
    ManagedBy   = "Terraform"
  }

  # Lifecycle management
  lifecycle {
    create_before_destroy = true
    prevent_destroy       = false
  }
}

Data Source (queries existing infrastructure):

data "aws_ami" "ubuntu" {
  most_recent = true
  owners      = ["099720109477"] # Canonical

  filter {
    name   = "name"
    values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
  }
}

Variable Declaration:

variable "instance_type" {
  description = "EC2 instance type"
  type        = string
  default     = "t3.micro"

  validation {
    condition     = contains(["t3.micro", "t3.small", "t3.medium"], var.instance_type)
    error_message = "Instance type must be t3.micro, t3.small, or t3.medium."
  }
}

Output Values:

output "instance_public_ip" {
  description = "Public IP address of the web server"
  value       = aws_instance.web_server.public_ip
  sensitive   = false
}

Step 3: Plan Changes

# Preview infrastructure changes
terraform plan

# Save plan to file for review
terraform plan -out=tfplan

# Plan for specific target resource
terraform plan -target=aws_instance.web_server

# Show plan with variable values
terraform plan -var="environment=production"

Plan Output Analysis:

  • + = Resource will be created
  • - = Resource will be destroyed
  • ~ = Resource will be modified in-place
  • -/+ = Resource will be destroyed and recreated
  • <= = Data source will be read

Step 4: Apply Changes

# Apply changes (requires confirmation)
terraform apply

# Apply saved plan (no confirmation needed)
terraform apply tfplan

# Auto-approve (use with caution)
terrafor
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

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

references/index.mdreferences/other.md

FAQ

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

HashiCorp Terraform Infrastructure as Code (IaC) tool for provisioning, managing, and versioning cloud infrastructure

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

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

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

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить terraform с