terraform
Plugin that validates Terraform formatting and syntax and provides three infrastructure-as-code skills.
- CCM score
- 41 of 100
- GitHub stars
- 201
Own this plugin? Claim it
What it does
- Adds three skills (
terraform-configuration,terraform-modules, andterraform-state) for writing, reusing, and managing Terraform code - Covers configuration organization, reusable module creation, and remote state with locking
- Runs
terraform fmtandterraform validatethrough ahooks.jsonhook on directories containing.tffiles - Designed for teams provisioning cloud resources with Terraform and wanting checks during editing
Terraform configuration validation and infrastructure-as-code best practices
Add marketplace
/plugin marketplace add TheBushidoCollective/hanRun it inside Claude Code once, then install the plugin below.
Install
/plugin install terraform@hanRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceTerraform Configuration
Writing and organizing Terraform infrastructure-as-code configurations.
Basic Structure
# Provider configuration
terraform {
required_version = ">= 1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "my-terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
}
}
provider "aws" {
region = var.region
}
Resources
resource "aws_instance" "web" {
ami = var.ami_id
instance_type = var.instance_type
tags = {
Name = "web-server"
Environment = var.environment
}
lifecycle {
create_before_destroy = true
prevent_destroy = false
}
}
Variables
variable "environment" {
description = "Environment name"
type = string
default = "development"
validation {
condition = contains(["development", "staging", "production"], var.environment)
error_message = "Environment must be development, staging, or production."
}
}
variable "instance_count" {
description = "Number of instances"
type = number
default = 1
}
variable "tags" {
description = "Resource tags"
type = map(string)
default = {}
}
Outputs
output "instance_id" {
description = "ID of the EC2 instance"
value = aws_instance.web.id
}
output "public_ip" {
description = "Public IP address"
value = aws_instance.web.public_ip
sensitive = false
}
Data Sources
data "aws_ami" "amazon_linux" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-hvm-*-x86_64-gp2"]
}
}
data "aws_vpc" "default" {
default = true
}
Locals
locals {
common_tags = {
Project = "myapp"
ManagedBy = "terraform"
Environment = var.environment
}
name_prefix = "${var.project}-${var.environment}"
}
resource "aws_instance" "web" {
# ...
tags = merge(local.common_tags, {
Name = "${local.name_prefix}-web"
})
}
Common Commands
# Initialize
terraform init
# Format
terraform fmt -recursive
# Validate
terraform validate
# Plan
terraform plan -out=tfplan
# Apply
terraform apply tfplan
# Destroy
terraform destroy
# Show state
terraform show
# List resources
terraform state list
Best Practices
File Organization
project/
├── main.tf # Main resources
├── variables.tf # Variable declarations
├── outputs.tf # Output declarations
├── versions.tf # Provider versions
├── terraform.tfvars # Variable values (gitignored if sensitive)
└── modules/ # Local modules
└── network/
Use Variables for Flexibility
# Bad
resource "aws_instance" "web" {
instance_type = "t2.micro"
}
# Good
resource "aws_instance" "web" {
instance_type = var.instance_type
}
Use Locals for Computed Values
locals {
timestamp = formatdate("YYYY-MM-DD-hhmmss", timestamp())
full_name = "${var.prefix}-${var.name}-${var.suffix}"
}
Readme
Terraform
Terraform configuration validation and infrastructure-as-code best practices.
Features
- Validates Terraform configuration formatting with
terraform fmt - Validates Terraform syntax and configuration with
terraform validate - Provides skills for working with Terraform configurations, state, and modules
Requirements
Install Terraform:
# macOS
brew install terraform
# Linux
wget https://releases.hashicorp.com/terraform/1.6.0/terraform_1.6.0_linux_amd64.zip
unzip terraform_1.6.0_linux_amd64.zip
sudo mv terraform /usr/local/bin/
Skills Included
- terraform-configuration: Writing and organizing Terraform configurations
- terraform-state: Managing Terraform state files
- terraform-modules: Creating reusable Terraform modules
Hook Behavior
Validates Terraform configurations in directories containing .tf files using terraform fmt and terraform validate.
Installation
han plugin install terraform
Details
- Marketplace
- TheBushidoCollective/han
- Source
- plugins/tools/terraform
- Category
- Tool
- Keywords
- terraform, infrastructure, iac, devops, hashicorp
- Listed since
- Apr 7, 2026
More from TheBushidoCollective/han
All 340Similar to terraform
More DevOps & Cloudjutsu-terraformTheBushidoCollective/han201 starsTerraform configuration validation and infrastructure-as-code best practices
pulumiTheBushidoCollective/han201 starsPulumi infrastructure-as-code validation and best practices
iac-terraformahmedasmar/devops-claude-skills206 starsInfrastructure as Code with Terraform and Terragrunt. Use this skill whenever the user mentions Terraform, Terragrunt, HCL, or infrastructure as code. Triggers
infra-pipelinedotclaude/marketplace43 starsComplete infrastructure lifecycle from IaC to deployment. Master AWS, Terraform, CI/CD pipelines, GitOps workflows, and deployment automation.
cloud-infrastructurewshobson/agents42.9K starsCloud architecture design for AWS/Azure/GCP/OCI, Kubernetes cluster configuration, Terraform infrastructure-as-code, hybrid cloud networking, and multi-cloud co
voltagent-infraVoltAgent/awesome-claude-code-subagents26.8K starsDevOps, cloud, and deployment specialists - Kubernetes, Terraform, AWS, Azure, GCP, and SRE