terraform
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
countfor loops ortemplatefilefor 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.
More from alphaonedev/openclaw-graph
playwright-scraper
Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots
1.4Kgcp-iam
Manages identity and access control for Google Cloud resources using IAM policies and roles.
370humanize-ai-text
AI text humanization: reduce AI-detection patterns, natural phrasing, tone adjustment
261macos-automation
AppleScript, JXA, Shortcuts, Automator, osascript, System Events, accessibility API
173tavily-web-search
Tavily: web search optimized for AI agents, answer synthesis, domain filtering, depth control
155clawflows
OpenClaw workflow automation: multi-step task chains, conditional logic, triggers, schedule
102