-->

DEVOPSZONES

  • Recent blogs

    How to Install tfswitch: The Terraform Switcher

     

    tfswitch
    tfswitch

    tfswitch

    If you are suposed to  work on multiple terraform versions, then you may need a switcher to juggle out between these versions. "terraform-switcher" comes to your rescue here. 

    The tfswitch command line tool lets you switch between different versions of terraform. If you do not have a particular version of terraform installed, tfswitch lets you download the version you desire. The installation is minimal and easy. Once installed, simply select the version you require from the dropdown and start using terraform.

    Installation

    tfswitch is available for MacOS and Linux based operating systems.

    Homebrew

    Installation for MacOS is the easiest with Homebrew. If you do not have homebrew installed, click here.

    brew install warrensbox/tap/tfswitch
    

    Linux

    Installation for Linux operation systems.

    curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash

    How to use:Use dropdown menu to select version

    1. You can switch between different versions of terraform by typing the command tfswitch on your terminal.
    2. Select the version of terraform you require by using the up and down arrow.
    3. Hit Enter to select the desired version.

    The most recently selected versions are presented at the top of the dropdown.

    Supply version on command line

    1. You can also supply the desired version as an argument on the command line.
    2. For example, tfswitch 1.1.0 for version 1.1.0 of terraform.
    3. Hit Enter to switch.

    See all versions including beta, alpha and release candidates(rc)

    1. Display all versions including beta, alpha and release candidates(rc).
    2. For example, tfswitch -l or tfswitch --list-all to see all versions.
    3. Hit Enter to select the desired version.

    Use environment variable

    You can also set the TF_VERSION environment variable to your desired terraform version. For example:

    export TF_VERSION=0.14.4
    tfswitch #will automatically switch to terraform version 0.14.4

    Install latest version only

    1. Install the latest stable version only.
    2. Run tfswitch -u or tfswitch --latest.
    3. Hit Enter to install.

    tfswitch repository: https://github.com/warrensbox/terraform-switcher


    No comments