{"id":5361,"date":"2022-06-15T00:23:29","date_gmt":"2022-06-14T16:23:29","guid":{"rendered":"https:\/\/www.jameseduard.com\/?p=5361"},"modified":"2022-06-15T00:23:29","modified_gmt":"2022-06-14T16:23:29","slug":"how-to-install-terraform-on-macos","status":"publish","type":"post","link":"https:\/\/www.jameseduard.com\/?p=5361","title":{"rendered":"How to Install Terraform on MacOS"},"content":{"rendered":"\n\n\n<p class=\"wp-block-paragraph\">In the article or tutorial i will guide you how to install Terraform on MacOS, Installing Terraform on MacOS is quite simple, there is a unique way of installation.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Installation for MacOS is the easiest with HomeBrew.<\/li><li>Manual Installation from Binary<\/li><li>Using TFSwitch<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Check Official Terraform&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/learn.hashicorp.com\/tutorials\/terraform\/install-cli\" target=\"_blank\">documentation<\/a>.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"using-homebrew\">Using Homebrew<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to stick to the classical Terraform installation, you can still use homebrew:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">brew install hashicorp\/tap\/terraform<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can verify your current version with:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">terraform -v<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"manual-install\">Manual Installation with Binary<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Terraform is distribuited as a single binary, you can find the latest version on&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.terraform.io\/downloads.html\" target=\"_blank\">Terraform website<\/a>.<br>After downloading Terraform we can simply put the binary in a directory listed in&nbsp;<code>PATH<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">mv ~\/Downloads\/terraform \/usr\/local\/bin\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To check if the installation is working properly:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">terraform -v<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"using-tfswitch\">Using TFSwitch<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<code>tfswitch<\/code>&nbsp;command line tool lets you switch between different versions of&nbsp;<a href=\"https:\/\/www.terraform.io\/\">terraform<\/a>. If you do not have a particular version of terraform installed,&nbsp;<code>tfswitch<\/code>&nbsp;will 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.<br><code>tfswitch<\/code>&nbsp;is available for MacOS and Linux based operating systems.<br>Before starting make sure to uninstall Terraform if you have it already installed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To install TFSwitch we can use homebrew, &nbsp;<a href=\"https:\/\/brew.sh\/\">If you do not have homebrew installed, click here<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">brew install warrensbox\/tap\/tfswitch<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to use:<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/warrensbox\/terraform-switcher#use-dropdown-menu-to-select-version\"><\/a>Use dropdown menu to select version<\/h3>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/d4ede30857af599271a942bcda0ef6c31ba66893e5410d81b81776fbb1b0f9c5\/68747470733a2f2f73332e75732d656173742d322e616d617a6f6e6177732e636f6d2f6b65706c65722d696d616765732f77617272656e73626f782f74667377697463682f74667377697463682e6769662331\" alt=\"drawing\" width=\"835\" height=\"501\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\"><li>You can switch between different versions of terraform by typing the command&nbsp;<code>tfswitch<\/code>&nbsp;on your terminal.<\/li><li>Select the version of terraform you require by using the up and down arrow.<\/li><li>Hit&nbsp;<strong>Enter<\/strong>&nbsp;to select the desired version.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the article or tutorial i will guide you how to install Terraform on MacOS, Installing Terraform on MacOS is quite simple, there is a unique way of installation. Installation for MacOS is the easiest with HomeBrew. Manual Installation from Binary Using TFSwitch Check Official Terraform&nbsp;documentation. Using Homebrew If you want to stick to the<\/p>\n","protected":false},"author":1,"featured_media":4062,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52,47,916,91],"tags":[918,90,628,92],"class_list":["post-5361","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-how-tos","category-macos","category-terraform","tag-howtos","tag-iac","tag-macos","tag-terraform"],"_links":{"self":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/5361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5361"}],"version-history":[{"count":0,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/5361\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}