Install brew, PowerShell and Terraform on my MacBook Pro running OS X

From Iwan
Jump to: navigation, search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

I have some scripting experience with perl, python and I have been doing some Visual Basic programming back in the days but I never really used Terraform. PowerCLI is not new for me as I created some scripts in the past. After reading some blogs and watching some YouTube video’s I realised I had chosen the right path for me. But where do I start? What script do I use to achieve what result?

Start with Brew

Brew is a package manager for OS X. With this package manager we install Terraform and PowerShell

Install Brew on OS X

CLICK ON EXPAND ===> ON THE RIGHT ===> TO SEE THE OUTPUT (Brew installation output) ===> :

ihoogendoor-a01:My-Local-Scripts-Directory iwanhoogendoorn$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”
==> This script will install»
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable»
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/share
/usr/local/lib/pkgconfig
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
==> The following existing directories will have their owner set to iwanhoogendoorn»
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/share
/usr/local/lib/pkgconfig
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
==> The following existing directories will have their group set to admin»
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/share
/usr/local/lib/pkgconfig
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
==> The following new directories will be created»
/usr/local/etc
/usr/local/sbin
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
Press RETURN to continue or any other key to abort
Password:
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /usr/sbin/chown iwanhoogendoorn /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /bin/mkdir -p /usr/local/etc /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/etc /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/sbin/chown iwanhoogendoorn /usr/local/etc /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/etc /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /Users/iwanhoogendoorn/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/iwanhoogendoorn/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown iwanhoogendoorn /Users/iwanhoogendoorn/Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Enumerating objects: 66, done.
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 100% (65/65), done.
remote: Total 132519 (delta 7), reused 54 (delta 1), pack-reused 132453
Receiving objects: 100% (132519/132519), 31.85 MiB - 13.77 MiB/s, done.
Resolving deltas: 100% (97260/97260), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
 * [new tag]             0.1        -> 0.1
 * [new tag]             0.2        -> 0.2
 * [new tag]             0.3        -> 0.3
 * [new tag]             0.4        -> 0.4
 * [new tag]             0.5        -> 0.5
 * [new tag]             0.6        -> 0.6
 * [new tag]             0.7        -> 0.7
 * [new tag]             0.7.1      -> 0.7.1
 * [new tag]             0.8        -> 0.8
 * [new tag]             0.8.1      -> 0.8.1
 * [new tag]             0.9        -> 0.9
 * [new tag]             0.9.1      -> 0.9.1
 * [new tag]             0.9.2      -> 0.9.2
 * [new tag]             0.9.3      -> 0.9.3
 * [new tag]             0.9.4      -> 0.9.4
 * [new tag]             0.9.5      -> 0.9.5
 * [new tag]             0.9.8      -> 0.9.8
 * [new tag]             0.9.9      -> 0.9.9
 * [new tag]             1.0.0      -> 1.0.0
 * [new tag]             1.0.1      -> 1.0.1
 * [new tag]             1.0.2      -> 1.0.2
 * [new tag]             1.0.3      -> 1.0.3
 * [new tag]             1.0.4      -> 1.0.4
 * [new tag]             1.0.5      -> 1.0.5
 * [new tag]             1.0.6      -> 1.0.6
 * [new tag]             1.0.7      -> 1.0.7
 * [new tag]             1.0.8      -> 1.0.8
 * [new tag]             1.0.9      -> 1.0.9
 * [new tag]             1.1.0      -> 1.1.0
 * [new tag]             1.1.1      -> 1.1.1
 * [new tag]             1.1.10     -> 1.1.10
 * [new tag]             1.1.11     -> 1.1.11
 * [new tag]             1.1.12     -> 1.1.12
 * [new tag]             1.1.13     -> 1.1.13
 * [new tag]             1.1.2      -> 1.1.2
 * [new tag]             1.1.3      -> 1.1.3
 * [new tag]             1.1.4      -> 1.1.4
 * [new tag]             1.1.5      -> 1.1.5
 * [new tag]             1.1.6      -> 1.1.6
 * [new tag]             1.1.7      -> 1.1.7
 * [new tag]             1.1.8      -> 1.1.8
 * [new tag]             1.1.9      -> 1.1.9
 * [new tag]             1.2.0      -> 1.2.0
 * [new tag]             1.2.1      -> 1.2.1
 * [new tag]             1.2.2      -> 1.2.2
 * [new tag]             1.2.3      -> 1.2.3
 * [new tag]             1.2.4      -> 1.2.4
 * [new tag]             1.2.5      -> 1.2.5
 * [new tag]             1.2.6      -> 1.2.6
 * [new tag]             1.3.0      -> 1.3.0
 * [new tag]             1.3.1      -> 1.3.1
 * [new tag]             1.3.2      -> 1.3.2
 * [new tag]             1.3.3      -> 1.3.3
 * [new tag]             1.3.4      -> 1.3.4
 * [new tag]             1.3.5      -> 1.3.5
 * [new tag]             1.3.6      -> 1.3.6
 * [new tag]             1.3.7      -> 1.3.7
 * [new tag]             1.3.8      -> 1.3.8
 * [new tag]             1.3.9      -> 1.3.9
 * [new tag]             1.4.0      -> 1.4.0
 * [new tag]             1.4.1      -> 1.4.1
 * [new tag]             1.4.2      -> 1.4.2
 * [new tag]             1.4.3      -> 1.4.3
 * [new tag]             1.5.0      -> 1.5.0
 * [new tag]             1.5.1      -> 1.5.1
 * [new tag]             1.5.10     -> 1.5.10
 * [new tag]             1.5.11     -> 1.5.11
 * [new tag]             1.5.12     -> 1.5.12
 * [new tag]             1.5.13     -> 1.5.13
 * [new tag]             1.5.14     -> 1.5.14
 * [new tag]             1.5.2      -> 1.5.2
 * [new tag]             1.5.3      -> 1.5.3
 * [new tag]             1.5.4      -> 1.5.4
 * [new tag]             1.5.5      -> 1.5.5
 * [new tag]             1.5.6      -> 1.5.6
 * [new tag]             1.5.7      -> 1.5.7
 * [new tag]             1.5.8      -> 1.5.8
 * [new tag]             1.5.9      -> 1.5.9
 * [new tag]             1.6.0      -> 1.6.0
 * [new tag]             1.6.1      -> 1.6.1
 * [new tag]             1.6.10     -> 1.6.10
 * [new tag]             1.6.11     -> 1.6.11
 * [new tag]             1.6.12     -> 1.6.12
 * [new tag]             1.6.13     -> 1.6.13
 * [new tag]             1.6.14     -> 1.6.14
 * [new tag]             1.6.15     -> 1.6.15
 * [new tag]             1.6.16     -> 1.6.16
 * [new tag]             1.6.17     -> 1.6.17
 * [new tag]             1.6.2      -> 1.6.2
 * [new tag]             1.6.3      -> 1.6.3
 * [new tag]             1.6.4      -> 1.6.4
 * [new tag]             1.6.5      -> 1.6.5
 * [new tag]             1.6.6      -> 1.6.6
 * [new tag]             1.6.7      -> 1.6.7
 * [new tag]             1.6.8      -> 1.6.8
 * [new tag]             1.6.9      -> 1.6.9
 * [new tag]             1.7.0      -> 1.7.0
 * [new tag]             1.7.1      -> 1.7.1
 * [new tag]             1.7.2      -> 1.7.2
 * [new tag]             1.7.3      -> 1.7.3
 * [new tag]             1.7.4      -> 1.7.4
 * [new tag]             1.7.5      -> 1.7.5
 * [new tag]             1.7.6      -> 1.7.6
 * [new tag]             1.7.7      -> 1.7.7
 * [new tag]             1.8.0      -> 1.8.0
 * [new tag]             1.8.1      -> 1.8.1
 * [new tag]             1.8.2      -> 1.8.2
 * [new tag]             1.8.3      -> 1.8.3
 * [new tag]             1.8.4      -> 1.8.4
 * [new tag]             1.8.5      -> 1.8.5
 * [new tag]             1.8.6      -> 1.8.6
 * [new tag]             1.9.0      -> 1.9.0
 * [new tag]             1.9.1      -> 1.9.1
 * [new tag]             1.9.2      -> 1.9.2
 * [new tag]             1.9.3      -> 1.9.3
 * [new tag]             2.0.0      -> 2.0.0
 * [new tag]             2.0.1      -> 2.0.1
 * [new tag]             2.0.2      -> 2.0.2
 * [new tag]             2.0.3      -> 2.0.3
 * [new tag]             2.0.4      -> 2.0.4
 * [new tag]             2.0.5      -> 2.0.5
 * [new tag]             2.0.6      -> 2.0.6
 * [new tag]             2.1.0      -> 2.1.0
 * [new tag]             2.1.1      -> 2.1.1
 * [new tag]             2.1.10     -> 2.1.10
 * [new tag]             2.1.11     -> 2.1.11
 * [new tag]             2.1.12     -> 2.1.12
 * [new tag]             2.1.13     -> 2.1.13
 * [new tag]             2.1.14     -> 2.1.14
 * [new tag]             2.1.15     -> 2.1.15
 * [new tag]             2.1.16     -> 2.1.16
 * [new tag]             2.1.2      -> 2.1.2
 * [new tag]             2.1.3      -> 2.1.3
 * [new tag]             2.1.4      -> 2.1.4
 * [new tag]             2.1.5      -> 2.1.5
 * [new tag]             2.1.6      -> 2.1.6
 * [new tag]             2.1.7      -> 2.1.7
 * [new tag]             2.1.8      -> 2.1.8
 * [new tag]             2.1.9      -> 2.1.9
 * [new tag]             2.2.0      -> 2.2.0
 * [new tag]             2.2.1      -> 2.2.1
 * [new tag]             2.2.10     -> 2.2.10
 * [new tag]             2.2.2      -> 2.2.2
 * [new tag]             2.2.3      -> 2.2.3
 * [new tag]             2.2.4      -> 2.2.4
 * [new tag]             2.2.5      -> 2.2.5
 * [new tag]             2.2.6      -> 2.2.6
 * [new tag]             2.2.7      -> 2.2.7
 * [new tag]             2.2.8      -> 2.2.8
 * [new tag]             2.2.9      -> 2.2.9
*HEAD* is now at db121c7b1 Merge pull request #7167 from MikeMcQuaid/linelength
==> Homebrew is run entirely by unpaid volunteers. Please consider donating»
  https://github.com/Homebrew/brew#donations
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 84, done.
remote: Counting objects: 100% (84/84), done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 694197 (delta 40), reused 51 (delta 31), pack-reused 694113
Receiving objects: 100% (694197/694197), 279.89 MiB - 11.78 MiB/s, done.
Resolving deltas: 100% (455928/455928), done.
Checking out files: 100% (5169/5169), done.
Tapped 2 commands and 4931 formulae (5,193 files, 307MB).
Already up-to-date.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating»
  https://github.com/Homebrew/brew#donations
==> Next steps»
- Run `brew help` to get started
- Further documentation:
    https://docs.brew.sh
ihoogendoor-a01:My-Local-Scripts-Directory iwanhoogendoorn$

Source

Install PowerShell 〈using Brew〉

ihoogendoor-a01:~ iwanhoogendoorn$ brew cask install powershell
==> Tapping homebrew/cask
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask’…
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 419545 (delta 0), reused 2 (delta 0), pack-reused 419540
Receiving objects: 100% (419545/419545), 190.32 MiB - 15.31 MiB/s, done.
Resolving deltas: 100% (296502/296502), done.
Tapped 1 command and 3489 casks (3,605 files, 204.2MB).
==> Downloading https»//github.com/PowerShell/PowerShell/releases/download/v7.0.
==> Downloading from https»//github-production-release-asset-2e65be.s3.amazonaws
root ######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'powershell'.
==> Installing Cask powershell
==> Running installer for powershell; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are i
Password:
installer: Package name is PowerShell - 7.0.0
installer: Installing at base path /
installer: The install was successful.
🍺  powershell was successfully installed!
ihoogendoor-a01:~ iwanhoogendoorn$

When PowerShell is installed on OS X you can start the PowerShell shell like this:

ihoogendoor-a01:~ iwanhoogendoorn$ pwsh
PowerShell 7.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/powershell
Type ‘help’ to get help.
PS /Users/iwanhoogendoorn>

Source

Install Terraform 〈using Brew〉

Terraform is latest version available (as the time of writing) of Terraform is 0.12. Terraform 0.12 coding syntax may be different and most example you find are the internet are written for 0.11 and before. For this reason I decided to install both versions of Terraform and switch between them when I require this.

Install Terraform v0 11

ihoogendoor-a01:~ iwanhoogendoorn$ brew install terraform@0.11
==> Downloading https»//homebrew.bintray.com/bottles/terraform@0.11-0.11.14.cata
==> Downloading from https»//akamai.bintray.com/e6/e6db9ebe826e856ff9bb10ffcb888
root ######################################################################## 100.0%
==> Pouring terraform@0.11-0.11.14.catalina.bottle.tar.gz
==> Caveats
terraform@0.11 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have terraform@0.11 first in your PATH run:
  echo ‘export PATH=“/usr/local/opt/terraform@0.11/bin:$PATH”’ >> ~/.bash_profile
==> Summary
🍺  /usr/local/Cellar/terraform@0.11/0.11.14: 6 files, 38.2MB
ihoogendoor-a01:~ iwanhoogendoorn$

Install Terraform v0 12

I already installed v0.11 but you can run the same command for updating and installing Terraform 0.12.

CLICK ON EXPAND ===> ON THE RIGHT ===> TO SEE THE OUTPUT (Terraform 0.12 installation output) ===> :

ihoogendoor-a01:~ iwanhoogendoorn$ brew install terraform@0.12
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
vpn-slice
==> Updated Formulae
agda                      erlang                    goreleaser                libhdhomerun              opa                       snapcraft
aws-cdk                   ethereum                  grpcurl                   libphonenumber            operator-sdk              syncthing
awscli                    exploitdb                 guile                     libuninameslist           osc                       teleport
bitrise                   firebase-cli              helm                      mailutils                 packetq                   tika
buildkit                  flow                      igraph                    mariadb-connector-odbc    pagmo                     tomcat
cargo-c                   flyway                    jbig2dec                  memcached                 pgbadger                  tomcat@8
ccache                    fork-cleaner              jenkins                   mesa                      pgroonga                  topgrade
cfn-lint                  futhark                   jfrog-cli-go              miller                    phpstan                   tor
commandbox                gatsby-cli                just                      minimal-racket            plantuml                  v8
consul                    genometools               k6                        mmctl                     powerman                  vegeta
crc                       gh                        knot                      mosquitto                 pulumi                    vim
devspace                  ghostscript               knot-resolver             navi                      rancid                    wildfly-as
docbook-xsl               git                       kubecfg                   netlify-cli               recon-ng                  xz
docker-slim               git-gui                   lazygit                   netpbm                    saxon                     yaegi
doctl                     glibmm                    lego                      nift                      scala@2.12
dvc                       glooctl                   leiningen                 node-build                ship
==> Updated Casks
abstract                               eclipse-installer                      logos                                  realm-studio
acquia-dev                             eclipse-java                           loom                                   rekordbox
activitywatch                          eclipse-modeling                       lunar                                  remotix-agent
adobe-acrobat-reader                   eclipse-php                            lyricsx                                riot
adobe-connect                          eclipse-rcp                            macs-fan-control                       roblox
adoptopenjdk                           eclipse-testing                        marvel                                 sapmachine-jdk
agenda                                 eventstore                             megasync                               second-life-viewer
aimersoft-video-converter-ultimate     expressvpn                             merlin-project                         securityspy
altdeploy                              feishu                                 metasploit                             sejda-pdf
anki                                   filebot                                metaz                                  sidenotes
antconc                                firecamp                               min                                    sidequest
anydo                                  flipper                                mjml                                   simplenote
appcode                                flock                                  murus                                  simsim
avocode                                fly                                    ocenaudio                              skype
axe-edit-iii                           fontgoggles                            ogdesign-eagle                         slite
azure-data-studio                      futuniuniu                             omnigraffle                            softraid
balsamiq-wireframes                    gitfinder                              omnioutliner                           switchkey
bisq                                   glyphs                                 openwebstart                           telegram-desktop
blocs                                  goodsync                               oracle-jdk-javadoc                     termius
bob                                    google-chrome                          papers                                 textexpander
bonjour-browser                        hashbackup                             pdf-expert                             trinity
bookmacster                            horos                                  permute                                tuple
borgbackup                             iconjar                                phpstorm                               turbovnc-viewer
brave-browser                          icq                                    plex-media-server                      typeface
burp-suite                             insync                                 portfolioperformance                   understand
camunda-modeler                        integrity                              postico                                virtualhostx
clion                                  intellij-idea                          postman                                visual-paradigm
composercat                            intellij-idea-ce                       power-manager                          visual-paradigm-ce
corona-tracker                         jamf-migrator                          prince                                 visual-studio-code
data-science-studio                    jami                                   propresenter                           vmware-horizon-client
datagrip                               java                                   protonmail-bridge                      vscodium
djay-pro                               joplin                                 proxyman                               webstorm
dotnet-sdk                             keep-it                                pycharm                                whalebird
downie                                 keystore-explorer                      pycharm-ce                             whatsapp
duefocus                               kitematic                              qcad                                   wire
duet                                   kiwi-for-g-suite                       qlab                                   xaos
ebmac                                  lando                                  razorsql
eclipse-dsl                            lark                                   react-native-debugger
eclipse-ide                            local                                  react-studio
==> Deleted Casks
colloquy                                                                       ichm

Warning: terraform 0.12.23 is already installed and up-to-date
To reinstall 0.12.23, run `brew reinstall terraform`
ihoogendoor-a01:~ iwanhoogendoorn$

When you run the following command, Brew will install the latest version of Terraform:

ihoogendoor-a01:~ iwanhoogendoorn$ brew install terraform

Terraform v0 11 and v0 12 side by side

Verify if v0.11 is available:

ihoogendoor-a01:~ iwanhoogendoorn$ cd /usr/local/opt/terraform\@0.11
ihoogendoor-a01:terraform@0.11 iwanhoogendoorn$ ls
CHANGELOG.md        INSTALL_RECEIPT.json    LICENSE            README.md        bin
ihoogendoor-a01:terraform@0.11 iwanhoogendoorn$ cd bin/
ihoogendoor-a01:bin iwanhoogendoorn$ ./terraform —version
Terraform v0.11.14

Your version of Terraform is out of date! The latest version
is 0.12.23. You can update by downloading from www.terraform.io/downloads.html 
ihoogendoor-a01:bin iwanhoogendoorn$

Verify if v0.12 Is available:

ihoogendoor-a01:bin iwanhoogendoorn$ cd /usr/local/Cellar/terraform/0.12.23
ihoogendoor-a01:0.12.23 iwanhoogendoorn$ ls
CHANGELOG.md        INSTALL_RECEIPT.json    LICENSE            README.md        bin
ihoogendoor-a01:0.12.23 iwanhoogendoorn$ cd bin/
ihoogendoor-a01:bin iwanhoogendoorn$ ./terraform —version
Terraform v0.12.23
ihoogendoor-a01:bin iwanhoogendoorn$

If you are using multiple versions of Terraform code that requires different Terraform versions you can install `tfenv`

First you need to unlink the current version you are running:

ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$ brew unlink terraform
Unlinking /usr/local/Cellar/terraform/0.12.23… 0 symlinks removed

Then you install `tfenv`:

ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$ brew install tfenv
==> Downloading https»//github.com/tfutils/tfenv/archive/v1.0.2.tar.gz
==> Downloading from https»//codeload.github.com/tfutils/tfenv/tar.gz/v1.0.2
root ######################################################################## 100.0%
🍺  /usr/local/Cellar/tfenv/1.0.2: 20 files, 29.2KB, built in 4 seconds

After `tfenv` is installed you can see what versions of Terraform are available:

CLICK ON EXPAND ===> ON THE RIGHT ===> TO SEE THE OUTPUT (List available Terraform versions) ===> :

ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$ tfenv list-remote
0.12.24
0.12.23
0.12.22
0.12.21
0.12.20
0.12.19
0.12.18
0.12.17
0.12.16
0.12.15
0.12.14
0.12.13
0.12.12
0.12.11
0.12.10
0.12.9
0.12.8
0.12.7
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.12.0-rc1
0.12.0-beta2
0.12.0-beta1
0.12.0-alpha4
0.12.0-alpha3
0.12.0-alpha2
0.12.0-alpha1
0.11.15-oci
0.11.14
0.11.13
0.11.12
0.11.12-beta1
0.11.11
0.11.10
0.11.9
0.11.9-beta1
0.11.8
0.11.7
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.11.0-rc1
0.11.0-beta1
0.10.8
0.10.7
0.10.6
0.10.5
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.10.0-rc1
0.10.0-beta2
0.10.0-beta1
0.9.11
0.9.10
0.9.9
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.13
0.7.12
0.7.11
0.7.10
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.16
0.6.15
0.6.14
0.6.13
0.6.12
0.6.11
0.6.10
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.3
0.5.1
0.5.0
0.4.2
0.4.1
0.4.0
0.3.7
0.3.6
0.3.5
0.3.1
0.3.0
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0

Now we install a specific older version of Terraform:

ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$ tfenv install 0.11.14
[INFO] Installing Terraform v0.11.14
[INFO] Downloading release tarball from https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_darwin_amd64.zip
root ###################################################################################################################################################### 100.0%
[INFO] Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_SHA256SUMS
tfenv: tfenv-install: [WARN] No keybase install found, skipping OpenPGP signature verification
Archive:  tfenv_download.TUwHUe/terraform_0.11.14_darwin_amd64.zip
  inflating: /usr/local/Cellar/tfenv/1.0.2/versions/0.11.14/terraform  
[INFO] Installation of terraform v0.11.14 successful
[INFO] Switching to v0.11.14
[INFO] Switching completed

Then we install a more recent version of Terraform:

ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$ tfenv install 0.12.20
[INFO] Installing Terraform v0.12.20
[INFO] Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.20/terraform_0.12.20_darwin_amd64.zip
root ###################################################################################################################################################### 100.0%
[INFO] Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.12.20/terraform_0.12.20_SHA256SUMS
tfenv: tfenv-install: [WARN] No keybase install found, skipping OpenPGP signature verification
Archive:  tfenv_download.UDN2wt/terraform_0.12.20_darwin_amd64.zip
  inflating: /usr/local/Cellar/tfenv/1.0.2/versions/0.12.20/terraform  
[INFO] Installation of terraform v0.12.20 successful
[INFO] Switching to v0.12.20
[INFO] Switching completed

Then we install the latest version of Terraform:

ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$ tfenv install 0.12.24
[INFO] Installing Terraform v0.12.24
[INFO] Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_darwin_amd64.zip
root ###################################################################################################################################################### 100.0%
[INFO] Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_SHA256SUMS
tfenv: tfenv-install: [WARN] No keybase install found, skipping OpenPGP signature verification
Archive:  tfenv_download.DW6IAV/terraform_0.12.24_darwin_amd64.zip
  inflating: /usr/local/Cellar/tfenv/1.0.2/versions/0.12.24/terraform  
[INFO] Installation of terraform v0.12.24 successful
[INFO] Switching to v0.12.24
[INFO] Switching completed

As you can see every time you install a new version it automatically switches to that latest installed version. If you want to switch back to a previous installed version you can do this as well:

ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$ tfenv use 0.12.20
[INFO] Switching to v0.12.20
[INFO] Switching completed
ihoogendoor-a01:#nested-routing-test iwanhoogendoorn$

Install Postman

Download the latest version here.

Create an account and sign in.

Connect to the NSX–T Manager using postman

Rutger Blom has written a very good blog article on how to use PostMan with NSX-T.

Sources

[[Category:NSX]