terraform

Terraform and Terragrunt for infrastructure as code. Use for IaC, modules, state management, HCL.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "terraform" with this command: npx skills add maroffo/claude-forge/maroffo-claude-forge-terraform

ABOUTME: Terraform/Terragrunt IaC patterns, modules, state management

ABOUTME: Best practices for HCL, DRY configs, security scanning

Terraform & Terragrunt

What's New (2025-2026)

FeatureDescription
Import blocksDeclarative imports without CLI
Check blocksContinuous validation assertions
Moved blocksRefactor without state surgery
Ephemeral (OpenTofu)Resources not stored in state

OpenTofu: CNCF fork, 100% compatible, recommended for new projects (BSL licensing).

Quick Reference

terraform init|plan|apply|destroy
terragrunt run-all apply
terraform fmt -recursive && terraform validate
terraform state list|show|rm|mv <resource>

See: _AST_GREP.md (sg patterns for HCL)


Project Structure

Simple: main.tf, variables.tf, outputs.tf, versions.tf

Multi-env:

terraform/
├── modules/{vpc,eks}/
└── environments/{dev,staging,prod}/

TF 1.5+ Blocks

import { to = aws_instance.web; id = "i-1234567890abcdef0" }
moved { from = aws_instance.web; to = module.web.aws_instance.main }
check "health" {
  data "http" "api" { url = "https://api.example.com/health" }
  assert { condition = data.http.api.status_code == 200; error_message = "API down" }
}

Terragrunt

Benefits: DRY configs, multi-env mgmt, dependency ordering, auto backend config

Structure

infrastructure/
├── terragrunt.hcl           # Root
├── _envcommon/{vpc,eks}.hcl
├── {dev,staging,prod}/
│   └── {region}/{vpc,eks}/terragrunt.hcl

Dependencies

dependency "vpc" { config_path = "../vpc" }
inputs = { vpc_id = dependency.vpc.outputs.vpc_id }

State Management

Split by: env, region, component, blast radius

backend "s3" { bucket = "my-state"; key = "prod/terraform.tfstate"; encrypt = true; dynamodb_table = "terraform-locks" }

Best Practices

DODON'T
Modules for reusable componentsHardcode values
Version modulesCommit .tfstate to git
sensitive = true for secretsShare state across envs

Testing & Security

Pipeline: fmt/validateTFLintCheckov/TrivyInfracost

terraform fmt -check -recursive && terraform validate
tflint --recursive
checkov -d . --framework terraform --compact
infracost breakdown --path .

Code Review Checklist

Security: No hardcoded secrets, encrypted state, locking enabled, least-privilege IAM, Checkov passes

Structure: Versioned modules, validated variables, consistent naming


Resources

ToolPurpose
TFLintLinter
CheckovSecurity
InfracostCost estimation

Docs: Terraform, OpenTofu, Terragrunt

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

clickup

No summary provided by upstream source.

Repository SourceNeeds Review
General

newsletter-digest

No summary provided by upstream source.

Repository SourceNeeds Review
General

rails

No summary provided by upstream source.

Repository SourceNeeds Review