title: Terraform: changing a list of variables into one list of maps
body: <p>I have 3 terraform variables which are lists.</p>
  <pre><code>container_ports = [5000, 5001]
  container_names = [&quot;image1&quot;, &quot;image2&quot;]
  load_balancer_arns = [&quot;lb1&quot;, &quot;1b2&quot;]
  </code></pre>
  <p>How do I change the structure into a list of maps like below?</p>
  <pre><code>ecs_service_lb_config = [
     {
      container_port = 5000
      container_name = &quot;image1&quot;
      load_balancer_arn = &quot;lb1
     },{
      container_port = 5001
      container_name = &quot;image2&quot;
      load_balancer_arn = &quot;lb2
     }
  ]    
  </code></pre>