Wednesday 2 September 2020

How to Install and Upgrade Terraform

Install Terraform on MAC:
1.Install Homebrew (The Missing Package Manager for macOS and Linux)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
2. Install terraform
$ brew install terraform
3. Check terraform Version 
$ terraform -v
Terraform v0.13.2

Install Terraform on Linux:
2.Copy Software to linux machine and unzip 
/home/oracle>unzip terraform_0.13.2_linux_amd64.zip
Archive:  terraform_0.13.2_linux_amd64.zip
  inflating: terraform      
         
/home/oracle> ls -ltr
total 117600
-rwxr-xr-x 1 oracle oinstall 85545348 Sep 1 07:39 terraform
-rw-r--r-- 1 oracle oinstall 34869122 Sep 1 08:16 terraform_0.13.2_linux_amd64.zip

3.Move Terraform to linux home path 
/home/oracle> mv terraform /usr/local/bin

/home/oracle> ls -ltr /usr/local/bin
total 83564
-rwxr-xr-x 1 oracle oinstall 85545348 Sep  1 07:39 terraform

4.Check terraform version 
/home/oracle> terraform -v
Terraform v0.13.2

Upgrade terraform to latest Version in MAC:
1.Present version 13.2 is out of date 
$terraform version 
Terraform v0.13.2
Your version of Terraform is out of date! The latest version
is 0.13.4. You can update by downloading from https://www.terraform.io/downloads.html

2.Upgrade to latest version (13.4)
$ brew upgrade terraform
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
asroute               flit                  leaf                  libnetfilter-queue    libxcomposite         libxkbfile            libxv                 server-go             xdpyinfo
blaze                 font-util             libaio                libnfnetlink          libxcursor            libxmu                libxvmc               shtools               xorgproto
box2d                 foreman               libdmx                libpciaccess          libxdamage            libxpm                libxxf86dga           structurizr-cli       xtrans
cloudformation-guard  fpart                 libdrm                libpthread-stubs      libxdmcp              libxrandr             libxxf86vm            tfsec                 zsh-you-should-use
commitizen            gcalcli               libfontenc            libsm                 libxext               libxrender            matplotplusplus       trunk
cvs-fast-export       git-hound             libfs                 libx11                libxfixes             libxres               or-tools              util-macros
device-mapper         gitql                 libgccjit             libxau                libxfont              libxscrnsaver         postgresql@12         vivid
dotnet                googletest            libhandy              libxaw                libxft                libxshmfence          protoc-gen-go-grpc    webify
envoy                 gost                  libice                libxaw3d              libxi                 libxt                 python@3.9            x86_64-elf-gdb
fleet-cli             halide                libmnl                libxcb                libxinerama           libxtst               rustscan              xcb-proto
==> Updated Formulae
Updated 1203 formulae.
==> Renamed Formulae
gst-validate -> gst-devtools
==> Deleted Formulae
meson-internal                                                                                       xu4

==> Upgrading 1 outdated package:
terraform 0.13.2 -> 0.13.4
==> Upgrading terraform 0.13.2 -> 0.13.4 
==> Downloading https://homebrew.bintray.com/bottles/terraform-0.13.4.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/05e7bf567f54c8396df8cf90470e573f5b08ebe8920bad1e638f531a54a152b6?response-content-disposition=attachment%3Bfilename%3D%22terraform-0.13.4.cat
######################################################################## 100.0%
==> Pouring terraform-0.13.4.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/terraform/0.13.4: 6 files, 67.6MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /usr/local/Cellar/terraform/0.13.2... (6 files, 67.6MB)
Removing: /Users/jay/Library/Caches/Homebrew/terraform--0.13.2.catalina.bottle.tar.gz... (19.8MB)
Removing: /Users/jay/Library/Logs/Homebrew/terraform... (64B)

3.Verify terraform version after upgrade
$ terraform version 
Terraform v0.13.4