macOS

Set up your MacBook for using Terraform.

Install

  1. Homebrew

    This page uses Homebrew for installs, and chances are you already using it.

    If you do not have it installed already, then follow the instructions on https://brew.sh.

  2. iTerm2

    You can use the default Terminal app or your preferred terminal emulator.

    We recommend iTerm2. You can download the stable version from the downloads page, or you can use Homebrew:

    brew install --cask iterm2
    

    You can customise iTerm2 to your hearts content, but going minimal is definitely recommended as a starting point.

    Appearance > General > Theme: Minimal

  3. Git

    brew install git
    
  4. GitHub CLI

    brew install gh
    
  5. Install the terraform binary

    brew tap hashicorp/tap
    brew install hashicorp/tap/terraform
    
  6. Azure CLI

    brew install azure-cli
    
  7. Install jq

    brew install jq
    

    If you want to customise the colours to match the jsonc output of the Azure CLI then add the following line into your ~/.zshrc file:

    export JQ_COLORS="1;90:1;34:0;34:1;36:0;33:1;37:1;37"
    
  8. Visual Studio Code

    Install vscode by following the instructions.

    Ensure you have installed the ‘code’ command in the PATH.

  9. Install the Hashicorp Terraform extension pack

The HashiCorp Terraform extension for Visual Studio Code (VS Code) with the Terraform Language Server adds editing features for Terraform files such as syntax highlighting, IntelliSense, code navigation, code formatting, module explorer, etc.

Validation

As a test, open up your terminal and check the following commands:

  1. Show the Azure CLI version

    az version
    
  2. Show the Terraform version

    terraform version
    
  3. Make a directory and move into it

    mkdir test
    cd test
    
  4. Open vscode from the command line

    code .
    

    This should open vscode with the current working directory in the Explorer pane.

    If you are using Ubuntu on WSL2 then you should see the Remote Development icon in the left hand side of the status bar at the bottom of the screen.

  5. Open the integrated terminal

    Click on View > Terminal in the menu, or use the keyboard shortcut, ^+`.

    Your selected shell should open up in the integrated terminal pane.


Help us improve

Azure Citadel is a community site built on GitHub, please contribute and send a pull request

 Make a change