title: How to for_each through a list(objects) in Terraform 0.12
body: <p>I need to deploy a list of GCP compute instances.  How do I loop for_each through the &quot;vms&quot; in a list of objects like this:</p>
  <pre><code>    &quot;gcp_zone&quot;: &quot;us-central1-a&quot;,
      &quot;image_name&quot;: &quot;centos-cloud/centos-7&quot;,
      &quot;vms&quot;: [
        {
          &quot;hostname&quot;: &quot;test1-srfe&quot;,
          &quot;cpu&quot;: 1,
          &quot;ram&quot;: 4,
          &quot;hdd&quot;: 15,
          &quot;log_drive&quot;: 300,
          &quot;template&quot;: &quot;Template-New&quot;,
          &quot;service_types&quot;: [
            &quot;sql&quot;,
            &quot;db01&quot;,
            &quot;db02&quot;
          ]
        },
        {
          &quot;hostname&quot;: &quot;test1-second&quot;,
          &quot;cpu&quot;: 1,
          &quot;ram&quot;: 4,
          &quot;hdd&quot;: 15,
          &quot;template&quot;: &quot;APPs-Template&quot;,
          &quot;service_types&quot;: [
            &quot;configs&quot;
          ]
        }
      ]    
  }
  </code></pre>