Terraform is an infrastructure as code tool that provisions and manages cloud and on-prem resources using declarative configuration files and a consistent plan-and-apply workflow.
Terraform uses HCL to declare resources and their desired relationships. The plan phase shows what will change before execution. The apply phase creates, updates, or deletes resources through provider plugins. State files track real-world resource mappings so Terraform knows what already exists.
That plan-then-apply model is what separates Terraform from imperative scripting. Operators see the exact diff before any change happens, which reduces surprise mutations in production. The state file is both Terraform's source of truth and its biggest operational liability; losing or corrupting state requires manual reconstruction.
Think of it like this. Think of an architect who draws the final building design, shows you the changes before construction starts, and keeps a master record of every room that was actually built.
Providers translate Terraform configurations into API calls for specific platforms such as AWS, Azure, GCP, or Kubernetes. Resources are declared with required arguments. Terraform builds a dependency graph, plans mutations, and applies them in order. Remote state backends allow team collaboration and locking.
"State files are safe in local folders." Local state blocks collaboration and increases loss risk. "Plan is always safe." Plan accuracy depends on correct configuration and unchanged external state. "Terraform replaces everything." In-place updates and import reduce disruption when used correctly.
Provider ecosystem breadth and declarative workflow, but state management adds operational overhead. Strong for multi-cloud provisioning; less suited for configuration management or mutable runtime changes.