meta_title: What is Terraform? Infrastructure as Code Explained
meta_description: Terraform is HashiCorp’s infrastructure as code tool for provisioning cloud and on-prem resources through declarative config files.
slug: terraform
post_excerpt: Terraform is HashiCorp’s open infrastructure as code tool that lets you define, version, and provision cloud and on-prem resources through declarative configuration files.
tool_url: https://www.terraform.io
tool_logo: https://www.google.com/s2/favicons?domain=terraform.io&sz=128
tool_pricing: Freemium
tool_category: Cloud / IaC
tool_industry: Engineering & Product
tool_similar: Pulumi, Ansible, AWS CloudFormation, OpenTofu, AWS CDK
tool_glossary: Infrastructure as Code (IaC), HCL, state file, provider, declarative configuration, immutable infrastructure
tool_features: |
Declarative HCL configuration language that describes the desired end state of your infrastructure
Multi-cloud support through thousands of community and official providers in the Terraform Registry
State file that tracks real infrastructure and detects drift from your configuration
Plan and apply workflow that previews every change before it touches production
Reusable modules for packaging and sharing standardized infrastructure patterns
Resource graph that parallelizes non-dependent resource creation for faster provisioning
faq_1_q: Is Terraform free to use?
faq_1_a: Yes. The Terraform CLI is free to download and run on your own machine or CI pipeline. HashiCorp’s hosted service, HCP Terraform, adds a paid tier for remote state, team collaboration, and policy enforcement once you exceed its free tier of 500 managed resources. Most solo developers and small teams never need to pay anything.
faq_2_q: What is the difference between Terraform and Ansible?
faq_2_a: Terraform provisions infrastructure: it creates and destroys servers, networks, and databases based on a declarative description of the end state. Ansible configures what already exists: it installs software, changes settings, and runs tasks on servers that are already running. Many teams use both together, Terraform to stand up the infrastructure and Ansible to configure it afterward.
faq_3_q: What is a Terraform state file?
faq_3_a: The state file is a JSON record of every resource Terraform has created and the metadata attached to it, like IDs, IP addresses, and configuration values. Terraform compares this file against your configuration and real infrastructure every time you run a plan, which is how it knows exactly what to create, change, or destroy. Losing or corrupting it makes your infrastructure hard to manage safely.
Terraform is HashiCorp’s infrastructure as code tool: you describe the servers, networks, and databases you need in a text file, and Terraform creates them for you. Instead of clicking through a cloud console or running one-off scripts, you write a configuration once, and Terraform figures out the order of operations, tracks what already exists, and updates only what changed. It works across AWS, Azure, Google Cloud, Kubernetes, and thousands of other providers through a single, consistent workflow. For AI teams standing up GPU clusters, vector databases, and inference endpoints across multiple providers, Terraform turns infrastructure into version-controlled code instead of tribal knowledge locked in someone’s head.
Terraform runs on a simple loop: you write what you want, Terraform shows you what it will do, and you approve before anything changes. It talks to cloud providers through their APIs, so it can create a virtual machine on AWS the same way it creates one on Azure, just through a different provider plugin.
Here is how the core workflow breaks down:
The leading public cloud for production AI workloads.
Cloud / IaCVector Agents provides role-based AI digital workers that automate sales, customer support, finance, and HR workflows for business teams.
AssistantPromptfoo is an open-source CLI and library for testing, evaluating, and red-teaming LLM applications and agents before they reach production.
ObservabilityAider is a free, open-source AI pair programmer that runs in your terminal and commits every code change to git automatically.
Coding AgentUpdates from the AI world — what shipped, what we’re using in production, and what’s worth your attention. Two emails a month, no spam.