0

I am trying to use Terragrunt for the first time. I have directory with terraform.tfvars. When I run "terragrunt get" just to get ball rolling, I get:

[terragrunt] 2017/08/08 11:08:14 exec: "terraform": executable file not found in %PATH%

This is despite that fact I have terraform in my path. What could be wrong?

I am using Gitbash as my shell on Windows 7 machine. I use terraform literally several times a day from gitbash.

 $ which terragrunt
/c/WINDOWS/system32/terragrunt

 $ which terragrunt
/c/WINDOWS/system32/terragrunt

~/GITS/terra-heroku/us/dev (master)
$ which terraform
/c/WINDOWS/system32/terraform

~/GITS/terra-heroku/us/dev (master)
$ terraform --version
Terraform v0.9.4

Your version of Terraform is out of date! The latest version
is 0.10.0. You can update by downloading from www.terraform.io

~/GITS/terra-heroku/us/dev (master)
$ terragrunt --version
terragrunt version v0.12.25

 #cat terraform.tfvars
terragrunt = {
  terraform {
    source = "git::[email protected]:westfieldcorp/tf-m-heroku-spsr-stack.git"
  }

include = {
    path = "${find_in_parent_folders()}"
  }
}

app_name = "foobar-service"   

$ echo $PATH
/c/Users/mr/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/mrashid/bin:/c/ProgramData/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/WebEx/Productivity Tools:/c/Program Files/Lenovo/Touch Fingerprint Software:/c/Program Files (x86)/Sennheiser/SoftphoneSDK:/c/opscode/chefdk/bin:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/c/Program Files/Amazon/AWSCLI:/c/ProgramData/chocolatey/bin:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/idmu/common:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Users/mrashid/AppData/Local/Programs/Python/Python36/Scripts:/c/Users/mrashid/AppData/Local/Programs/Python/Python36:/c/Ruby22/bin:/c/Users/mr/.babun:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/c/Users/mrashid/.babun/cygwin/bin:/c/pstools:/c/Program Files/Heroku/bin:/c/users/mrashid/appdata/Local/programs/python/python36:/usr/bin/vendor_perl:/usr/bin/core_perl

Any help is sincerely appreciated.

2 Answers 2

2

This happens when "terraform init" command has not been run. Once, that was done, terragrunt worked.

2
  • 1
    That's odd - terragrunt runs auto-init by default, so running an get should've run init.
    – volvox
    Jun 20, 2018 at 13:16
  • Thanks, seemed obvious once I read this
    – IamAshay
    Jun 7, 2023 at 21:23
1

Just for the sake of others who are also facing similar issue with Terragrunt i.e. "terraform": executable file not found in $PATH. Please check if you have installed terraform executable properly or not. To verify that follow:

  1. which terraform

sample output -> /bin/terraform

  1. echo $PATH

sample outut -> /usr/local/sbin:/sbin:/usr/sbin:/usr/bin

Here we can observe that the /bin path is missing. To add that execute below command

  1. echo "PATH=$PATH:/bin" >> ~/.bashrc

  2. source ~/.bashrc

  3. terragrunt init OR terragrunt run-all init

This should work fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.