Skip to content

Latest commit

 

History

History
191 lines (128 loc) · 6.73 KB

File metadata and controls

191 lines (128 loc) · 6.73 KB

Troubleshooting: Known Errors

Costa Rica

GitHub Cloud2BR OSS - Learning Hub

Last updated: 2025-07-16


Content

Terraform is not recognized

Terraform is not recognized because it's not installed or not added to your system's PATH

terraform : The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the 
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ terraform init
+ ~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (terraform:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

image

Step 1: Download Terraform

By command line:

  1. Open your command prompt.

  2. Use curl to download Terraform. Replace VERSION with the desired version number (e.g., 1.1.4):

    curl -o terraform.zip https://releases.hashicorp.com/terraform/VERSION/terraform_VERSION_windows_amd64.zip
    
    image
  3. Use tar to extract the ZIP file:

    tar -xvf terraform.zip
    
    image

By GUI:

  1. Go to the Terraform download page.

  2. Download the appropriate package for your operating system (e.g., Windows, macOS, Linux).

    image

Step 2: Install Terraform

For Windows

  1. Extract the downloaded ZIP file to a directory of your choice (e.g., C:\terraform).

    image
  2. Add the directory to your system's PATH:

    By command line:
    Assuming you have moved terraform.exe to C:\terraform, you can add this directory to the PATH using the following command

    setx PATH "%PATH%;C:\terraform"
    
    image

    By GUI:

    • Open the Start menu and search for Environment Variables.

    • Click on Edit the system environment variables

      image
    • In the System Properties window, click on Environment Variables.

      image
    • Under System variables, find the Path variable and click Edit.

    • Click New and add the path to the directory where you extracted Terraform (e.g., C:\terraform).

    • Click OK to close all windows.

For macOS

  1. Open a terminal.

  2. Move the Terraform binary to a directory included in your PATH (e.g., /usr/local/bin):

    sudo mv ~/Downloads/terraform /usr/local/bin/
  3. Ensure the directory is in your PATH by adding the following line to your ~/.bash_profile or ~/.zshrc file:

    export PATH=$PATH:/usr/local/bin
  4. Reload your profile:

    source ~/.bash_profile  # or source ~/.zshrc

For Linux

  1. Open a terminal.

  2. Move the Terraform binary to a directory included in your PATH (e.g., /usr/local/bin):

    sudo mv ~/Downloads/terraform /usr/local/bin/
  3. Ensure the directory is in your PATH by adding the following line to your ~/.bashrc or ~/.profile file:

    export PATH=$PATH:/usr/local/bin
  4. Reload your profile:

    source ~/.bashrc  # or source ~/.profile

Step 3: Verify the Installation

  1. Open a new terminal or command prompt.

  2. Run the following command to verify the installation. You should see the installed version of Terraform.

    terraform -version

Step 4: Initialize Terraform

Now you can run the terraform init command in your project directory:

terraform init

Resource Group Not Found

Please ensure you create your resource group before running the configuration and deployment. This error occurs because the specified resource group does not exist.

Error: Failed to get existing workspaces: Error retrieving keys for Storage Account "examplestorageacct": storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceGroupNotFound" Message="Resource group 'RGWorkshopUserName' could not be found." but I want to create it

image

Resource Not Found

Please ensure you create your storage account and container for backend before running the configuration and deployment. This error occurs because the specified storage account does not exist.

Error: Failed to get existing workspaces: Error retrieving keys for Storage Account "examplestorageacct": storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/examplestorageacct' under resource group 'RGWorkshopUserName' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"

image

Total views

Refresh Date: 2026-04-06