title: How to deploy a specific tf file (Terraform)
body: <p>I have 3 .tf files in my terraform root directory:</p>
  
  <ul>
  <li>vpc.tf   </li>
  <li>subnets.tf   </li>
  <li>instances.tf   </li>
  <li>Along with the .terraform directory after running terraform init</li>
  </ul>
  
  <p>I would like to deploy only vpc.tf running something like:</p>
  
  <pre><code>terraform apply vpc.tf #here, vpc.tf is a terraform file
  </code></pre>
  
  <p>But it doesn't work (I get a Go error: "zip: not a valid zip file"). 
  If I just run </p>
  
  <pre><code>terraform apply
  </code></pre>
  
  <p>it will try to apply all configurations in all 3 terraform files (vpc.tf, subnets.tf and instances.tf) which is not what I want.
  It seems that the way to have this to work is, have a completely different folder, and run something like</p>
  
  <pre><code>terraform apply vpc/ #here, vpc/ is a folder that containers vpc.tf file
  </code></pre>
  
  <p>which works. The problem with this approach, is that if I have 2 or more terraform files within the vpc/ folder, I come back to the first problem all over again.
  It seems the solution for this is to have a specific resource in a specific folder, but this doesn't seem clean, as I can foresee that if the infrastructure grows, I will end up with several folders containing a few terraform files.
  So the question is: </p>
  
  <p>Is there a way to "terraform apply" a specific terraform file, and ignore all the rest within a folder? Am I missing something basic about terraform?</p>