Use when creating and using reusable Terraform modules for organizing and sharing infrastructure code.
Creates reusable Terraform modules with proper structure, variables, and outputs. Use when organizing infrastructure code into shareable components or calling existing modules from local paths, registries, or Git repositories.
/plugin marketplace add TheBushidoCollective/han/plugin install jutsu-shfmt@hanThis skill cannot use any tools. It operates in read-only mode without the ability to modify files or execute commands.
Creating and using reusable Terraform modules.
modules/vpc/
├── main.tf
├── variables.tf
├── outputs.tf
└── README.md
resource "aws_vpc" "main" {
cidr_block = var.cidr_block
enable_dns_hostnames = var.enable_dns_hostnames
tags = merge(var.tags, {
Name = var.name
})
}
resource "aws_subnet" "public" {
count = length(var.public_subnets)
vpc_id = aws_vpc.main.id
cidr_block = var.public_subnets[count.index]
availability_zone = var.availability_zones[count.index]
tags = merge(var.tags, {
Name = "${var.name}-public-${count.index + 1}"
})
}
variable "name" {
description = "VPC name"
type = string
}
variable "cidr_block" {
description = "VPC CIDR block"
type = string
}
variable "public_subnets" {
description = "Public subnet CIDR blocks"
type = list(string)
default = []
}
variable "tags" {
description = "Resource tags"
type = map(string)
default = {}
}
output "vpc_id" {
description = "VPC ID"
value = aws_vpc.main.id
}
output "public_subnet_ids" {
description = "Public subnet IDs"
value = aws_subnet.public[*].id
}
module "vpc" {
source = "./modules/vpc"
name = "production-vpc"
cidr_block = "10.0.0.0/16"
public_subnets = [
"10.0.1.0/24",
"10.0.2.0/24",
]
tags = {
Environment = "production"
}
}
# Access module outputs
resource "aws_instance" "web" {
subnet_id = module.vpc.public_subnet_ids[0]
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.0.0"
name = "my-vpc"
cidr = "10.0.0.0/16"
azs = ["us-east-1a", "us-east-1b"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24"]
enable_nat_gateway = true
enable_vpn_gateway = false
}
module "vpc" {
source = "git::https://github.com/org/terraform-modules.git//vpc?ref=v1.0.0"
name = "my-vpc"
# ...
}
module "network" {
source = "./modules/network"
name = var.name
}
module "compute" {
source = "./modules/compute"
vpc_id = module.network.vpc_id
subnet_id = module.network.subnet_ids[0]
}
module "database" {
source = "./modules/database"
vpc_id = module.network.vpc_id
subnet_ids = module.network.private_subnet_ids
}
variable "applications" {
type = map(object({
instance_type = string
ami_id = string
}))
}
module "application" {
for_each = var.applications
source = "./modules/application"
name = each.key
instance_type = each.value.instance_type
ami_id = each.value.ami_id
}
module "worker" {
count = var.worker_count
source = "./modules/worker"
name = "worker-${count.index + 1}"
index = count.index
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.0" # Allow patch updates
}
variable "environment" {
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "Environment must be dev, staging, or prod."
}
}
output "vpc_id" {
value = aws_vpc.main.id
}
output "vpc_cidr" {
value = aws_vpc.main.cidr_block
}
output "subnet_ids" {
value = aws_subnet.main[*].id
}
variable "name_prefix" {
type = string
}
locals {
name = "${var.name_prefix}-${var.environment}"
}
terraform-<PROVIDER>-<NAME>
terraform-aws-vpc
terraform-google-network
v1.0.0 - Major release
v1.1.0 - Minor release
v1.1.1 - Patch release
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.