terraform

Installation
SKILL.md

terraform

Purpose

Terraform is a command-line tool for defining and provisioning infrastructure as code using declarative HCL (HashiCorp Configuration Language) files. It enables users to create, update, and destroy cloud resources in a repeatable, version-controlled manner.

When to Use

Use Terraform for managing multi-cloud environments, automating infrastructure deployments, or when you need version-controlled IaC for resources like VMs, networks, or databases. Apply it in scenarios involving AWS, Azure, or GCP provisioning, especially for dynamic scaling, disaster recovery setups, or CI/CD pipelines to ensure consistency.

Key Capabilities

  • Declarative HCL syntax for defining resources, e.g., resource "aws_instance" "example" { ami = "ami-123456" instance_type = "t2.micro" }.
  • Provider support for over 100 services; configure with blocks like provider "aws" { region = "us-west-2" }.
  • State management via local files or remote backends (e.g., S3) to track resource changes.
  • Module reuse for composing configurations; import with module "vpc" { source = "./modules/vpc" }.
  • Variable interpolation and functions, such as count for loops or templatefile for dynamic configs.

Usage Patterns

To use Terraform, start by writing an HCL file (e.g., main.tf) defining resources and providers. Initialize the workspace with terraform init, review changes via terraform plan, and apply them with terraform apply. For automation, wrap commands in scripts and use environment variables for secrets. Always version control your .tf files in Git. For multi-environment setups, use workspaces: terraform workspace new dev then switch with terraform workspace select dev.

Related skills
Installs
22
GitHub Stars
5
First Seen
Mar 7, 2026