Install Terraform on MacOS
Terraform on MacOS

Install Terraform on MacOS

Let's start with downloading the terraform binary file, signature file, check sums and HashiCorp's GPG Key.

  • Binary Package - ARM64 for Mac Processor, AMD64 for Intel Processor
  • Checksums Signature File
  • SHA256 Checksums

Download Link: https://developer.hashicorp.com/terraform/downloads?product_intent=terraform

Download Terraform Binary file and Other files as mentioned

  • HashiCorp GPG key

HashiCorp GPG Key

HashiCorp GPG Key can be downloaded from: https://www.hashicorp.com/trust/security?ajs_aid=2ac9e1c8-143d-483c-b79a-93d3d0412a9a&product_intent=terraform

Step 2 is to install GPG - https://gpgtools.org

Install GPG Suite

GPG is used to:

  1. Import above downloaded HashiCorp key, and
  2. Verify if Terraform signature files are untampered

Use GPG to verify if Terraform Signature Files are Untampered

Step 3 is to check SHA256 Checksums matches the Terraform binary.

Command to check the same: shasum -a 256 -c terraform_1.6.3.=_SHA256SUMS

-a stands for algorithm

Check SHA256 checksums matches the Terraform Binary

Note: I validated checksums against binary file using checksum which was exact match for my binary file. This was taken from terraform_1.6.3_SHA256SUMS.txt downloaded in Step 1.

8cad19d5f34c6ab2af21219fc3968ba30084f5e39bf219230706d360869ed8e9? terraform_1.6.3_darwin_arm64.zip

Step 4 is to extract the zipped Terraform binary file in a folder, point to that folder in terminal and then modify the PATH in Mac as:

% mv terraform /usr/local/bin

?While doing as above, I had faced Permission Error, which was fixed using:

% sudo chown -R $(whoami) /usr/local/bin

Modify Path in Mac

Now, we can verify if Terraform has installed correctly or not by running:

terraform -help

Above screenshot confirms terraform is installed successfully.

要查看或添加评论,请登录

Navneet Singh G.的更多文章

社区洞察

其他会员也浏览了