title: Conditional attributes in Terraform
body: <p>Does Terraform support conditional attributes? I only want to use an attribute depending on a variable's value.</p>
  
  <p>Example:</p>
  
  <pre><code>resource "aws_ebs_volume" "my_volume" {
    availability_zone = "xyz"
    size              = 30
  
    if ${var.staging_mode} == true:
      snapshot_id = "a_specific_snapshot_id"
    endif
  }
  </code></pre>
  
  <p>The above <code>if</code> statement enclosing the attribute <code>snapshot_id</code> is what I'm looking for. Does Terraform support such attribute inclusion based on a variable's value.</p>