Terraform: Introduction & Getting Started
Terraform is an open-source infrastructure as code (IaC) tool by HashiCorp for provisioning and managing cloud and on-premises resources declaratively.
Why Use Terraform?
- Manage infrastructure as code across multiple providers
- Declarative, version-controlled infrastructure
- Large ecosystem of providers and modules
How Terraform Works
- Uses HCL (HashiCorp Configuration Language) for configuration files
- Providers enable support for different platforms (AWS, Azure, etc.)
- State files track resource status
Quick Start Example
- Install Terraform:
- Write a simple configuration (
main.tf
): - Initialize and apply: