title: Combine two lists into a formatted string in Terraform
body: <p>I need to create a string parameter to pass to the aws-cli via local-exec so need to combine two lists from the remote state into the required format, cannot think of a good way to do this using the inbuilt interpolation functions.</p>
  
  <p>Required string format</p>
  
  <pre><code>"SubnetId=subnet-x,Ip=ip_x SubnetId=subnet--y,Ip=ip_y SubnetId=subnet-z,Ip=ip_z"
  </code></pre>
  
  <p>We have the subnets and corresponding cidrs in two separate lists.</p>
  
  <pre><code>["subnet-x","subnet-y","subnet-z"]
  ["cidr-x","cidr-y","cidr-z"]
  </code></pre>
  
  <p>Was thinking I could use the cidrhost function to obtain the IPs but cannot see a way to format the two lists into the one string.</p>