What is Terraform and how does it differ from other Infrastructure as Code tools?

Beginner

Answer

Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp that allows you to define and provision infrastructure using declarative configuration files. Unlike imperative tools that require you to specify step-by-step instructions, Terraform uses a declarative approach where you describe the desired end state.

Key differences from other IaC tools:

  • Provider-agnostic: Works with multiple cloud providers (AWS, Azure, GCP, etc.)
  • State management: Maintains a state file to track real-world resources
  • Plan and apply workflow: Shows changes before applying them
  • Immutable infrastructure: Replaces resources rather than modifying them in place