terraform
Skill4 starsChanged 9 months agoMITView on GitHub
Terraform infrastructure as code patterns, modules, and best practices. Trigger: When working with Terraform configurations, modules, or infrastructure provisioning.
27 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- Ghost7802/awesome-api-skillstheir own version, first seen Nov 29, 2026
- amutaal122/ai-engineer-mastertheir own version, first seen Nov 29, 2026
- iliaal/ai-skillstheir own version, first seen Nov 28, 2026
- AshrafDurjoy/genai-shared-patternstheir own version, first seen Nov 16, 2026
- lengrufeng2008/dsh-skill-librarytheir own version, first seen Nov 15, 2026
- iuliandita/skillstheir own version, first seen Nov 15, 2026
Used with
Projects with it also use ansible, kubernetes and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
julweberSkillansible
Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose.
Also in 4 projects that use this
mjunaidcaSkillkubernetes
Production-grade Kubernetes manifests and debugging for containerized applications. This skill should be used when users ask to deploy to Kubernetes, create K8s manifests, containerize for K8s, set up Deployments/Services/Jobs/StatefulSets/CronJobs, create namespaces with resource quotas, set up multi-team isolation, configure ResourceQuota/ LimitRange, secure with RBAC (ServiceAccount, Role, RoleBinding), configure init containers (model download, db wait, migrations), set up sidecars (logging, metrics), or debug pods (CrashLoopBackOff, logs, exec, describe, events). Auto-detects from Dockerfile/code, generates hardened manifests with educational comments. CKAD-aligned.
Also in 8 projects that use this
elie222Skillprisma
How to use Prisma
Also in 3 projects that use this
thechandanbhagatSkillsql
Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.
Also in 3 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 6 projects that use this
JetBrainsSkillvue
Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.
Also in 4 projects that use this
Other versions27 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- G1Joshi/Agent-Skills★ 1511% same
- ffsshhttiikk/opencode-agents-skills★ 223% same
- ihiteshgupta/ClaudeSkills★ 014% same
Wrote their own version · 24
- Mindrally/skills★ 275same name
- magnus919/agent-skills★ 197same name
- nitinjain999/platform-skills★ 71same name
- iliaal/ai-skills★ 46same name
- nimadorostkar/Claude-Skills-collection★ 41same name
- georgekhananaev/claude-skills-vault★ 32same name
- greedychipmunk/agent-skills★ 24same name
- maroffo/claude-forge★ 15same name
- Ghost7802/awesome-api-skills★ 13same name
- iuliandita/skills★ 12same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- code-snippetsSkill
- devops-notionSkill
- devops-prSkill
- github-actionsSkill
- kubernetes-helmSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 25 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 395
ALWAYS use remote state with S3 + DynamoDB locking
- Distinctive: line 396
ALWAYS enable versioning on state bucket
- Distinctive: line 397
ALWAYS use variables for dynamic values
- Distinctive: line 398
Use data sources to reference existing resources
- Distinctive: line 400
Use modules for reusable infrastructure components
- Very specific: line 401
Use terraform fmt before committing
- Very specific: line 402
Use terraform validate in CI/CD
- Distinctive: line 404
Use workspaces or separate state files per environment
- Distinctive: line 405
Document modules with README.md and examples
“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Purpose
You are a specialist in Terraform infrastructure as code. You help create, modify, and optimize Terraform configurations following best practices.
Common Patterns
Basic Provider Configuration
# providers.tf
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"
encrypt = true
dynamodb_table = "terraform-locks"
}
}
provider "aws" {
region = var.aws_region
default_tags {
tags = {
Environment = var.environment
ManagedBy = "Terraform"
Project = var.project_name
}
}
}Variables Pattern
# variables.tf
variable "environment" {
description = "Environment name (dev, staging, prod)"
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "Environment must be dev, staging, or prod."
}
}
variable "aws_region" {
description = "AWS region"
type = string
default = "us-east-1"
}
variable "vpc_cidr" {
description = "CIDR block for VPC"
type = string
default = "10.0.0.0/16"
}
variable "tags" {
description = "Common tags for all resources"
type = map(string)
default = {}
}Outputs Pattern
# outputs.tf
output "vpc_id" {
description = "ID of the VPC"
value = aws_vpc.main.id
}
output "public_subnet_ids" {
description = "List of public subnet IDs"
value = aws_subnet.public[*].id
}
output "nat_gateway_ips" {
description = "Elastic IPs of NAT Gateways"
value = aws_eip.nat[*].public_ip
}VPC Module Example
# modules/vpc/main.tf
resource "aws_vpc" "main" {
cidr_block = var.vpc_cidr
enable_dns_hostnames = true
enable_dns_support = true
tags = merge(
var.tags,
{
Name = "${var.project_name}-${var.environment}-vpc"
}
)
}
resource "aws_subnet" "public" {
count = length(var.availability_zones)
vpc_id = aws_vpc.main.id
cidr_block = cidrsubnet(var.vpc_cidr, 8, count.index)
availability_zone = var.availability_zones[count.index]
map_public_ip_on_launch = true
tags = merge(
var.tags,
{
Name = "${var.project_name}-${var.environment}-public-${var.availability_zones[count.index]}"
Type = "public"
}
)
}
resource "aws_subnet" "private" {
count = length(var.availability_zones)
vpc_id = aws_vpc.main.id
cidr_block = cidrsubnet(var.vpc_cidr, 8, count.index + 10)
availability_zone = var.availability_zones[count.index]
tags = merge(
var.tags,
{
Name = "${var.project_name}-${var.environment}-private-${var.availability_zones[count.index]}"
Type = "private"
}
)
}
resource "aws_internet_gateway" "main" {
vpc_id = aws_vpc.main.id
tags = merge(
var.tags,
{
Name = "${var.project_name}-${var.environment}-igw"
}
)
}
resource "aws_eip" "nat" {
count = length(var.availability_zones)
domain = "vpc"
tags = merge(
var.tags,
{
Name = "${var.project_name}-${var.environment}-nat-eip-${var.availability_zones[count.index]}"
}
)
depends_on = [aws_internet_gateway.main]
}
resource "aws_nat_gateway" "main" {
count = length(var.availability_zones)
allocation_id = aws_eip.nat[count.index].id
subnet_id = aws_subnet.public[count.index].id
tags = merge(
var.tags,
{
Name = "${var.project_name}-${var.environment}-nat-${var.availability_zones[count.index]}"
}
)
depends_on = [aws_internet_gateway.main]
}EKS Cluster Example
# modules/eks/main.tf
resource "aws_eks_cluster" "main" {
name = "${var.project_name}-${var.environment}-eks"
role_arn = aws_iam_role.eks_cluster.arn
version = var.kubernetes_version
vpc_config {
subnet_ids = concat(var.public_subnet_ids, var.private_subnet_ids)
endpoint_private_access = true
endpoint_public_access = true
public_access_cidrs = var.cluster_endpoint_public_access_cidrs
security_group_ids = [aws_security_group.eks_cluster.id]
}
enabled_cluster_log_types = [
"api",
"audit",
"authenticator",
"controllerManager",
"scheduler"
]
depends_on = [
aws_iam_role_policy_attachment.eks_cluster_policy,
aws_cloudwatch_log_group.eks_cluster
]
tags = var.tags
}
resource "aws_eks_node_group" "main" {
cluster_name = aws_eks_cluster.main.name
node_group_name = "${var.project_name}-${var.environment}-node-group"
node_role_arn = aws_iam_role.eks_node_group.arn
subnet_ids = var.private_subnet_ids
scaling_config {
desired_size = var.desired_capacity
max_size = var.max_capacity
min_size = var.min_capacity
}
instance_types = var.instance_types
capacity_type = var.capacity_type
disk_size = var.disk_size
update_config {
max_unavailable = 1
}
labels = {
Environment = var.environment
NodeGroup = "primary"
}
depends_on = [
aws_iam_role_policy_attachment.eks_worker_node_policy,
aws_iam_role_policy_attachment.eks_cni_policy,
aws_iam_role_policy_attachment.eks_container_registry_policy
]
tags = var.tags
}S3 Backend Setup
# backend-setup/main.tf
resource "aws_s3_bucket" "terraform_state" {
bucket = "my-terraform-state-${var.account_id}"
tags = {
Name = "Terraform State"
Environment = "shared"
}
}
resource "aws_s3_bucket_versioning" "terraform_state" {
bucket = aws_s3_bucket.terraform_state.id
versioning_configuration {
status = "Enabled"
}
}
resource "aws_s3_bucket_server_side_encryption_configuration" "terraform_state" {
bucket = aws_s3_bucket.terraform_state.id
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
resource "aws_s3_bucket_public_access_block" "terraform_state" {
bucket = aws_s3_bucket.terraform_state.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
resource "aws_dynamodb_table" "terraform_locks" {
name = "terraform-locks"
billing_mode = "PAY_PER_REQUEST"
hash_key = "LockID"
attribute {
name = "LockID"
type = "S"
}
tags = {
Name = "Terraform Lock Table"
Environment = "shared"
}
}Best Practices
Workspace Management
# Create and use workspaces
terraform workspace new dev
terraform workspace new staging
terraform workspace new prod
# Switch workspace
terraform workspace select dev
# List workspaces
terraform workspace listtfvars Files
# terraform.tfvars (default)
environment = "dev"
aws_region = "us-east-1"
project_name = "myapp"
# environments/dev.tfvars
environment = "dev"
instance_types = ["t3.medium"]
min_capacity = 1
max_capacity = 3
# environments/prod.tfvars
environment = "prod"
instance_types = ["t3.large", "t3.xlarge"]
min_capacity = 3
max_capacity = 10Common Commands
# Initialize
terraform init
# Plan with specific tfvars
terraform plan -var-file="environments/dev.tfvars"
# Apply with auto-approve
terraform apply -var-file="environments/prod.tfvars" -auto-approve
# Destroy
terraform destroy -var-file="environments/dev.tfvars"
# Format all files
terraform fmt -recursive
# Validate configuration
terraform validate
# Show current state
terraform show
# Import existing resource
terraform import aws_instance.example i-1234567890abcdef0
# Refresh state
terraform refresh
# Output specific value
terraform output vpc_idRules
- ALWAYS use remote state with S3 + DynamoDB locking
- ALWAYS enable versioning on state bucket
- ALWAYS use variables for dynamic values
- Use data sources to reference existing resources
- Tag ALL resources with Environment, ManagedBy, and Project
- Use modules for reusable infrastructure components
- Use
terraform fmtbefore committing - Use
terraform validatein CI/CD - Pin provider versions to avoid breaking changes
- Use workspaces or separate state files per environment
- Document modules with README.md and examples
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

