https://github.com/tfutils/tfenv
https://www.ios-net.co.jp/blog/20230322-861/
-- 1. インストール
brew unlink terraform
brew install tfenv
-- 2. 動作確認
tfenv list-remote
terraform --version
tfenv list
tfenv install 1.6.4
tfenv install 1.5.7
terraform --version
tfenv list
tfenv use 1.6.4
terraform --version
tfenv list
tfenv use 1.5.7
terraform --version
tfenv list
tfenv uninstall 1.6.4
terraform --version
tfenv list
ファイルによるバージョン切替
echo 1.6.4 > .terraform-version
tfenv use
terraform --version
tfenv list
echo 1.5.7 > .terraform-version
tfenv use
terraform --version
tfenv list
-- 3. アンインストール
rm -rf /usr/local/bin/tfenv