title: Terraform: count == true
body: <p>I have used this previously in my TF code:</p>
  
  <pre><code>count   = "${var.whatever == "true" ? 1 : 0}"
  </code></pre>
  
  <p>Which works great for what I wanted to use. However, I'm thinking of how best to use something similar to say, if <code>var.whatever</code> is equal to <code>true</code>, then count is equal to <code>length(var.whatever)</code>. </p>
  
  <p>Would this work?</p>
  
  <p><code>count = "${var.whatever == "true" ? ${length(var.whatever) : 0}"</code></p>
  
  <p>It's just that I was always under the impression with TF that you can't nest interpolations.</p>
  
  <p>Also, this kind of leads me to another interesting question.. what do you guys use to test syntax? I don't mean to lint the TF Code, I mean something to run the code against to test things like this? I don't want to just deploy to dev, just to test the output of my TF code. I was wondering if there was something, shell like, which I could literally test this stuff as is it were <code>bash</code> or something. Any thoughts?</p>