1. What Terraform Is (High-Level)
Terraform is an Infrastructure-as-Code (IaC) tool that lets you define infrastructure (servers, networks, DNS, cloud services) in declarative configuration files, then create and manage that infrastructure automatically.
Key idea:
- You describe what you want, not how to build it
- Terraform figures out the execution steps
2. Core Architecture
Terraform has a simple but powerful internal model:
2.1 Components
1. Configuration (Desired State)
- Written in HashiCorp Configuration Language (HCL)
- Defines resources, variables, outputs
2. State (Current Known State)
- Stored in a
.tfstate file
- Tracks real infrastructure Terraform manages
- Maps config → real-world resources
3. Providers
- Plugins that interact with APIs
- Examples:
- Amazon Web Services
- Microsoft Azure
- Google Cloud Platform
4. Resources