Menu

Setting Up Terraform

Setting Up Terraform

Installing Terraform on Windows, Linux and macOS

•  Windows: Download the AMD64 or ARM64 ZIP, extract terraform.exe to a folder such as C:\Terraform, add that folder to PATH, open a new PowerShell window and run terraform version.

•  macOS: With Homebrew, run the commands below, then verify the installed version.

•  Linux (Ubuntu/Debian): Use the official HashiCorp APT repository instructions on the installation page, install the terraform package, then run terraform version. Follow the matching RPM instructions for RHEL, Fedora or Amazon Linux.

•  Verification: Run terraform version. If the command is not found, check PATH and reopen the terminal.

Do not download executables from unofficial sites.

# Ubuntu / Debian: follow the official repository setup, then install:

sudo apt update && sudo apt install terraform
terraform version

brew tap hashicorp/tap
brew install hashicorp/tap/terraform
terraform version

Download Terraform only from the official installation page: https://developer.hashicorp.com/terraform/install. Select the package that matches your operating system and CPU architecture.

Setting Up VS Code and Terraform Extensions

  • Install the Terraform extension in VS Code for syntax highlighting and language support. Keep configuration in `.tf` files such as `main.tf`, `variables.tf` and `outputs.tf`.
  • Use the integrated terminal, but still run terraform fmt, terraform validate and review every plan.

Configuring Cloud Provider Credentials and Creating Your First Terraform Project

  • Use a local CLI profile or short-lived role credentials. Never hard-code access keys in .tf files or commit them to Git.
  • For AWS, configure a named AWS CLI profile and verify the account and region before applying a plan.

Terraform Tutorial

HA

Harini A



Learn via Video Course

undefined Logo

NaN hrs



Get in Touch For Details