How to use multiple terraform versions at one PC

H

Hi,

it often happens that it is required to manage multiple terraform versions at local machine. The question appears how to do it at easy and in convenient way. There are several ways how current problem can be resolved. At that article we will speak about tfenv util. Installation for Libux systems is rather simple:

1. Use git clone operation:

git clone https://github.com/tfutils/tfenv.git ~/.tfenv

2. Add ~/.tfenv/bin to your $PATH:

echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bash_profile

3. Create symlink to the executable files:

sudo ln -s ~/.tfenv/bin/* /usr/local/bin

In case any problems, you may refer to official documentation at tfenv github page

After you have tfenv to be install, you may manage terraform versions in the next way. To install any version of terraform use:

tfenv install [version]

To check what terraform versions do you have at your PC use the next command:

tfenv list

To switch between different terrafom versions:

tfenv use [version]

That’s all – easy-peasy 🙂

architecture AWS cluster cyber-security devops devops-basics docker elasticsearch flask geo high availability java machine learning opensearch php programming languages python recommendation systems search systems spring boot symfony

Privacy Overview
Sergii Demianchuk Blog

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

3rd Party Cookies

This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.