title: Using Terraform as an API
body: <p>I would like to use Terraform programmatically like an API/function calls to create and teardown infrastructure in multiple specific steps. e.g reserve a couple of eips, add an instance to a region and assign one of the IPs all in separate steps. Terraform will currently run locally and not on a server.</p>
  
  <p>I would like to know if there is a recommended way/best practices for creating the configuration to support this? So far it seems that my options are:</p>
  
  <ol>
  <li>Properly define input/output, heavily rely on resource separation, modules, the count parameter and interpolation. </li>
  <li>Generate the configuration files as JSON which appears to be less common</li>
  </ol>
  
  <p>Thanks!</p>