Skip to content

Instantly share code, notes, and snippets.

@sho-luv
Created March 19, 2020 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sho-luv/f04df99371c5eed0ecae59230feab270 to your computer and use it in GitHub Desktop.
Save sho-luv/f04df99371c5eed0ecae59230feab270 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
# download latest version of terraform:
TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \"\,\v | awk '{$1=$1};1'`
wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip
# unzip downloaded terraform:
unzip terraform_${TER_VER}_linux_amd64.zip
# delete zip file
rm unzip terraform_${TER_VER}_linux_amd64.zip
# move terraform to my path:
sudo mv terraform /usr/local/bin/
# check that its in the path
which terraform
# check what version was installed
terraform -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment