Terraform for AWS Installation Terraform CLI

Paul Ravvich
Tarraform using Amazon Web Services
2 min readMay 11, 2024

--

Terraform for GCP Installation

Hi, this is Paul, and welcome to the #1 part of my Terraform guide. Today we will discuss how to install Terraform.

Introduction

From the perspective of Terraform installation, our primary task is to install the Terraform CLI, which is essentially the Terraform binary that we need on our local desktop.

Additionally, if we are using AWS to provision infrastructure on the AWS cloud, then we’ll need the AWS CLI and the VS Code editor as an IDE for writing Terraform configuration files. We’ll also need the Terraform syntax-related language service plugin, often referred to as the Terraform Plugin for VS Code.

We’ll be installing these components based on whether we’re using Mac OS, Windows OS, or Linux OS, depending on our environment.

  • Install Terraform CLI
  • Install AWS CLI

Install Terraform CLI

You can download binaries from the official HashiCorp website:

MacOS

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

Or if you don't want to use brew you can install binaries manually:

$ mkdir /Users/<your-user>/Documents/terraform-install

# copy zip file to /Users/<your-user>/Documents/terraform-install

$ unzip terraform_<version>.zip

$ mv terraform /usr/local/bin

$ terraform version

Windows

After downloading terraform.exe you have to copy the file to the persistent directory like Documents or any other where you want. In my case, it will be C:\terraform-bin

  1. Click Win button and type env you need Edit the system environment variables
  2. Click on Environment Variables button
  3. In User variables for Administrator find Path row select this row and click Edit button
  4. Click New button and paste your path to the folder with Terraform in my case it is C:\terraform-bin
  5. Click Ok button
  6. Open a new terminal window and type terraform version

Linux

For Linux official documentation gives the most nitty-gritty instructions you have to select your Linux type and copy-paste paste command from here:

Thank you for reading until the end. Before you go:

Paul Ravvich

--

--

Paul Ravvich
Tarraform using Amazon Web Services

Software Engineer with over 10 years of XP. Join me for tips on Programming, System Design, and productivity in tech! New articles every Tuesday and Thursday!