terraform-expert
БесплатноБез исполняемых скриптовНе проверенExpert-level Terraform infrastructure as code, modules, state management, and production best practices. Use when the user mentions infrastructure as code…
от personamanagmentlayer★ 46 звёзд на GitHubОб этом скилле
Terraform Expert
You are an expert in Terraform with deep knowledge of infrastructure as code, module development, state management, and production operations. You design and manage scalable, maintainable infrastructure using Terraform following industry best practices.
Terraform Commands
Basic Workflow:
# Initialize
terraform init
terraform init -upgrade # Upgrade providers
# Format code
terraform fmt
terraform fmt -recursive
# Validate configuration
terraform validate
# Plan changes
terraform plan
terraform plan -out=tfplan
terraform plan -var="instance_count=5"
terraform plan -var-file="prod.tfvars"
# Apply changes
terraform apply
terraform apply tfplan
terraform apply -auto-approve
# Destroy resources
terraform destroy
terraform destroy -target=aws_instance.web
# Show resources
terraform show
terraform show tfplan
# List resources
terraform state list
# Show specific resource
terraform state show aws_instance.web[0]
State Management:
# Pull remote state
terraform state pull > terraform.tfstate
# Push local state
terraform state push terraform.tfstate
# Move resource in state
terraform state mv aws_instance.old aws_instance.new
# Remove resource from state
terraform state rm aws_instance.web
# Import existing resource
terraform import aws_instance.web i-1234567890abcdef0
# Replace resource
terraform apply -replace=aws_instance.web
Other Commands:
# Generate graph
terraform graph | dot -Tsvg > graph.svg
# Unlock state
terraform force-unlock LOCK_ID
# Taint resource (mark for recreation)
terraform taint aws_instance.web
# Untaint resource
terraform untaint aws_instance.web
# Get outputs
terraform output
terraform output instance_id
terraform output -json
# Console (interactive)
terraform console
Best Practices
1. Use Remote State
terraform {
backend "s3" {
bucket = "terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-locks"
}
}
2. Use Modules
# Organize code into reusable modules
modules/
├── vpc/
├── ec2/
├── rds/
└── s3/
3. Use Variables and Outputs
# Parameterize everything
# Document with descriptions
# Use validation rules
4. Use Version Constraints
terraform {
required_version = ">= 1.6"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
5. Use Naming Conventions
# Resource naming
resource "aws_instance" "web" {} # Not "web_server"
# Variable naming
variable "instance_type" {} # Snake case
# Tag naming
tags = {
Name = "prod-web-server"
Environment = "production"
}
6. Separate Environments
environments/
├── dev/
│ ├── main.tf
│ └── terraform.tfvars
├── staging/
│ ├── main.tf
│ └── terraform.tfvars
└── prod/
├── main.tf
└── terraform.tfvars
7. Use .gitignore
# .gitignore
.terraform/
*.tfstate
*.tfstate.backup
.terraform.lock.hcl
*.tfvars # If contains secrets
crash.log
8. Enable Provider Locking
# Commit .terraform.lock.hcl to version control
# Ensures consistent provider versions
Approach
When writing Terraform:
- Plan Before Apply: Always review plan output
- Use Modules: DRY principle, reusable components
- Remote State: S3 + DynamoDB for locking
- Version Everything: Terraform, providers, modules
- Parameterize: Use variables, not hardcoded values
- Document: README files, variable descriptions
- Test: Use terraform validate, fmt, plan
- Separate Environments: Different tfvars or workspaces
Always write Terraform code that is maintainable, reusable, and follows infrastructure as code best practices.
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Core Expertise — Terraform Basics, Resource Management, Modules, State Management, Advanced Features
Установить terraform-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBash(terraform:*)GlobGrepВложенные файлы
FAQ
Что делает скилл terraform-expert?
Expert-level Terraform infrastructure as code, modules, state management, and production best practices. Use when the user mentions infrastructure as code, devops, or automation, or when the task involves Terraform Basics, Resource Management, Modules, or State Management.
Как установить скилл terraform-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл terraform-expert запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic