Install tfenv Terraform version manager on Mac

Install with homebrew

GitHub: https://github.com/tfutils/tfenv

Install via brew

brew install tfenv

Once tfenv install complete, type tfenv in your terminal to validate.

❯ tfenv
tfenv 3.0.0
Usage: tfenv <command> [<options>]

Commands:
   install       Install a specific version of Terraform
   use           Switch a version to use
   uninstall     Uninstall a specific version of Terraform
   list          List all installed versions
   list-remote   List all installable versions
   version-name  Print current version
   init          Update environment to use tfenv correctly.
   pin           Write the current active version to ./.terraform-version

Install the latest version of Terraform

tfenv install latest

Installing Terraform v1.2.6
Downloading release tarball from https://releases.hashicorp.com/terraform/1.2.6/terraform_1.2.6_darwin_arm64.zip
######################################################################### 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.2.6/terraform_1.2.6_SHA256SUMS
Not instructed to use Local PGP (/opt/homebrew/Cellar/tfenv/3.0.0/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification
Archive:  /var/folders/4t/csczx371261_wt9qs6k4byw00000gn/T/tfenv_download.XXXXXX.6UwV1dNp/terraform_1.2.6_darwin_arm64.zip
  inflating: /opt/homebrew/Cellar/tfenv/3.0.0/versions/1.2.6/terraform
Installation of terraform v1.2.6 successful. To make this your default version, run 'tfenv use 1.2.6'

Setup installed Terraform version as global default version

❯ tfenv use latest

Switching default version to v1.2.6
Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 1.2.6

Validate terraform version

❯ terraform -v
Terraform v1.2.6
on darwin_arm64