Terraform
In plain English
Plain definition
Terraform is HashiCorp's infrastructure-as-code tool for declaratively defining, planning and applying changes to cloud and on-premises infrastructure through provider plugins and a state-tracked execution model.
Technical Definition
Terraform is an open-source infrastructure-as-code (IaC) tool developed by HashiCorp. It uses a declarative configuration language, HashiCorp Configuration Language (HCL), to define resources and their relationships. Terraform maintains a state file that records the last-known attributes of managed resources, compares that state against the configuration and the real infrastructure, and computes an execution plan describing the additions, changes and deletions required to reconcile the two. Providers — plugins for platforms such as AWS, Azure, Google Cloud or Kubernetes — translate Terraform’s resource model into calls against each platform’s API.
Operational Relevance
Terraform is used to provision and manage infrastructure consistently across environments, reducing configuration drift and manual error. Its plan-before-apply workflow gives operators a preview of intended changes before they take effect, which supports change review and approval processes. Because configuration is version-controlled text, infrastructure changes can go through the same review, testing and audit practices as application code. This matters operationally wherever infrastructure changes need to be predictable, reviewable and reversible.
Architecture Relationship
Terraform sits at the provisioning layer of a platform architecture: it creates and manages the underlying compute, network, storage and identity resources that other tools then configure or deploy onto. It is commonly paired with configuration-management tools (for in-instance configuration) and with CI/CD pipelines (to gate and automate plan/apply cycles). Terraform’s state file is a critical architectural dependency: it must be stored and locked reliably (for example in a remote backend) so that concurrent runs do not corrupt or diverge from the true infrastructure state.
Example
A minimal Terraform configuration might declare a single cloud storage bucket:
resource "aws_s3_bucket" "example" {
bucket = "kby-example-bucket"
}
Running terraform plan shows what would be created; running terraform apply creates it and records the result in state.
Misunderstanding
A common misunderstanding is that Terraform configuration alone is authoritative. In practice, Terraform’s understanding of infrastructure depends on its state file matching reality; manual changes made outside Terraform (through a console or another tool) can cause state to diverge from the actual infrastructure, leading to unexpected plans or failed applies. Terraform reconciles configuration against state, not against a live re-scan of every resource by default, so drift correction requires deliberate action such as terraform refresh or terraform plan review.
Related Terms
- Infrastructure as Code (IaC)
- HashiCorp Configuration Language (HCL)
- State file
- Provider (Terraform)
- Terraform plan/apply workflow
Further Reading
- Terraform documentation (HashiCorp) — canonical reference for configuration syntax, providers and workflow commands.
Verified Operational Checks and Next Steps
Before relying on any Terraform-managed environment, confirm the installed Terraform version and provider versions against the configuration’s required version constraints, and validate configuration syntax and an execution plan in an isolated or non-production workspace before applying to shared infrastructure. If state appears inconsistent with real infrastructure, treat this as a signal to review manual changes and reconcile deliberately rather than applying blind.