Introduction to Terraform Version Management Tool tfenv [macOS Edition]

Tadashi Shigeoka ·  Sat, November 14, 2020

I’ve installed and started using the Terraform version management tool tfenv on macOS, so I’ll introduce it.

Terraform | テラフォーム

Background: Using Multiple Versions of Terraform Concurrently / 背景 Terraform を複数バージョン併用する

As I’m working across multiple development projects, I wanted to manage and use multiple versions of Terraform.

Since tfenv can manage Terraform versions, I’ll introduce the steps from installing it on macOS to starting to use it.

Prerequisites: Uninstall terraform / 事前準備 terraform アンインストール

brew uninstall terraform

Install tfenv / tfenv インストール

brew install tfenv

Install terraform with tfenv / tfenv で terraform インストール

Install latest version of terraform / terraform 最新版インストール

tfenv install latest

Use the installed latest version of terraform.

$ tfenv use
Switching default version to v0.13.5
Switching completed

Install specific version of terraform / terraform version 指定インストール

tfenv install 0.13.4

List installed terraform versions / インストール済みの terraform 一覧

$ tfenv list
* 0.13.5 (set by /usr/local/Cellar/tfenv/2.0.0/version)
  0.13.4

That’s all from the Gemba.