Terraform for AWS Installation Terraform CLI
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
- Click
Win
button and typeenv
you needEdit the system environment variables
- Click on
Environment Variables
button - In User variables for Administrator find
Path
row select this row and clickEdit
button - Click
New
button and paste your path to the folder with Terraform in my case it isC:\terraform-bin
- Click
Ok
button - 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:
- Please consider clapping and following the writer! 👏
- Follow us on Twitter(X), LinkedIn