Write what you want
For example: “I need 1 server and 1 storage bucket.” You describe the desired end state.
Terraform automates infrastructure provisioning. Instead of manually creating servers, storage and networks in a cloud console, you describe what you want — Terraform figures out how to create it.
Terraform is an Infrastructure as Code (IaC) tool developed by HashiCorp. You write the desired infrastructure in configuration files instead of creating everything manually.
For example: “I need 1 server and 1 storage bucket.” You describe the desired end state.
Terraform uses providers to communicate with cloud platforms and determine the actions needed to reach your desired state.
Terraform supports many cloud and infrastructure providers rather than being tied to one particular cloud provider.
Think of ordering food at a restaurant: you say “one masala dosa and one filter coffee.” You do not need to tell the chef every action to perform. Terraform follows the same idea for infrastructure.
Suppose your team needs a web server for the application and a storage bucket for images, invoices and other files.
terraform plan to preview changes.terraform apply to create it.Terraform keeps track of the real-world resources it manages in a state file, commonly named terraform.tfstate. The state helps Terraform understand what already exists and what needs to change.
Your .tf files describe the desired infrastructure.
The state records the resources Terraform manages so future plans can calculate differences.
In real teams, state management should be designed carefully, commonly using a remote backend with appropriate access control and locking rather than casually sharing a local state file.
A simple beginner mental model: write → initialize → check → preview → apply.
.tf configuration.Automate repetitive infrastructure setup instead of manually repeating console steps.
Infrastructure is defined consistently in code, reducing mistakes caused by manual configuration.
Store infrastructure code in Git, review changes and see who changed what.
Use the same patterns for development, staging and production with controlled differences.
Work with many infrastructure providers instead of learning a completely separate provisioning workflow for every platform.
terraform plan gives you a chance to review intended changes before applying them.
| Command | Simple meaning | Changes real infrastructure? |
|---|---|---|
terraform init | Prepare the Terraform project and providers | No |
terraform fmt | Format Terraform files consistently | No |
terraform validate | Check whether configuration is valid | No |
terraform plan | Show what Terraform intends to change | No |
terraform apply | Apply the planned infrastructure changes | Yes |
terraform destroy | Remove infrastructure managed by the configuration | Yes — destructive |
No. Terraform is designed to work with many providers. AWS is just one example.
Terraform uses a declarative approach: you describe the desired end state, and Terraform determines the actions needed to reach it.
Because infrastructure becomes code. Git can provide history, reviews, collaboration and controlled rollbacks of configuration changes.
No. Plan is a preview. The infrastructure-changing command in this basic workflow is terraform apply.