title: Terraform throws "groupName cannot be used with the parameter subnet" or "VPC security groups may not be used for a non-VPC launch"
body: <p>When trying to figure out how to configure a <code>aws_instance</code> with AWS VPC the following errors occur:</p>
  
  <pre><code>* Error launching source instance: InvalidParameterCombination: The parameter groupName cannot be used with the parameter subnet
      status code: 400, request id: []
  </code></pre>
  
  <p>or</p>
  
  <pre><code>* Error launching source instance: InvalidParameterCombination: VPC security groups may not be used for a non-VPC launch
      status code: 400, request id: []
  </code></pre>