title: Using output from bash script as variable within Terraform
body: <p>I was wondering if someone could point me in the right direction, I am looking at verbalising our Kubernetes version within our Terraform module as currently its hard coded.</p>
  
  <p>Every now and then we get an error saying that our "orchestration version" isn't valid when we deploy our cluster - this is due to Azure dropping our Kubernetes version... (We deploy our dev/uat envs daily)</p>
  
  <p>So I came up with the idea of using a variable for our version so we can always deploy avoiding the "invalid orchestration" error. I scripted the bash script for what I need;</p>
  
  <pre><code>az aks get-versions --location westeurope --query 'orchestrators' -o tsv | awk '{print $3}' | tail -2 | head -n 1
  </code></pre>
  
  <p>But now I wish to use the output from ^^^ to use as our Kubernetes version within our Terraform module we deploy daily. </p>
  
  <p>Can anyone point me in the right direction? </p>
  
  <p>I've had a look at using build-args within the docker container.</p>