Installing Terraform and Provider Basics
You'll learn how to install the Terraform CLI, confirm it's working, and understand what providers do in the Terraform ecosystem.
Installing Terraform CLI
Terraform is distributed as a single binary file that runs on your operating system. Installation is straightforward:
- Download the appropriate package for your OS from HashiCorp's official site
- Unzip the archive to extract the
terraformbinary - Move the binary to a directory in your system's PATH (like
/usr/local/binon Linux/Mac orC:\Windows\System32on Windows)
Verify your installation by opening a terminal and running:
terraform version
You should see output showing the installed Terraform version. This confirms the CLI is ready to use.
Understanding Providers
Think of providers as translators between Terraform and cloud platforms. Terraform itself doesn't know how to create an AWS EC2 instance or Azure VM—providers bridge that gap.
A provider is a plugin that:
- Communicates with a specific platform's API (AWS, Azure, GCP, etc.)
- Translates your declarative configuration into API calls
- Manages the lifecycle of resources on that platform
Each provider must be declared in your configuration files before you can use its resources. When you run Terraform commands, it automatically downloads the required provider plugins based on your declarations.
Providers are versioned separately from Terraform itself, allowing platforms to update their APIs without waiting for a new Terraform release.
Key Takeaway: Terraform is installed as a standalone CLI tool, and providers act as platform-specific plugins that enable Terraform to manage resources across different cloud services and infrastructure platforms.