Terraform Brew



To install Terraform, find the appropriate package for your system and download it as a zip archive. After downloading Terraform, unzip the package. Terraform runs as a single binary named terraform. Any other files in the package can be safely removed and Terraform will still function. Terraformer generates tf / json + tfstate files from existing infrastructure. This is called reverse-terraforming. You can use it with AWS, GCP and Azure. Unfortunately Terraformer works only with. Brew 'kubectl' brew 'terraform' BREWFILE brew bundle -verbose Organizing into Modules. We’ll start by setting up this directory structure, and files referenced will use this. ├── gke │ ├── cluster.tf │ ├── gcp.tf │ └── variables.tf ├── k8s │ ├── k8s.tf │ ├── pods.tf │ ├── services.tf.

Terraform is distributed as a single binary. Install Terraform by unzipping it and moving it to a directory included in your system's PATH. You can find the SHA256 checksums for Terraform 0.15.0 online and you can verify the checksums signature file which has been signed using HashiCorp's GPG key.

  • 1Install brew, PowerShell, Terraform and Postman on my MacBook Pro running OS X
    • 1.1Start with Brew
    • 1.3Install Terraform (using Brew)
    • 1.4Install Postman

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

Brewing

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) > :

Install PowerShell (using Brew)


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


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


Install Terraform v0.12

Homebrew Terraform

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) > :

Brew Terraform-docs

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


ResourceTerraform brew update

Terraform v0.11 and v0.12 side by side

Verify if v0.11 is available:


Verify if v0.12 Is available:


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:


Then you install `tfenv`:


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) > :

Now we install a specific older version of Terraform:


Then we install a more recent version of Terraform:


Then we install the latest version of Terraform:


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:

Upgrade Terraform Version


Terraform Brew

Install Postman

Terraform bare metal

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.

Terraform Prevent Destroy

Sources

Brew Terraform 0.11

Retrieved from 'http://www.iwan.wiki/index.php?title=Install_brew,_PowerShell_and_Terraform_on_my_MacBook_Pro_running_OS_X&oldid=1655'