title: Terraform - Create a List of Objects from List of Values
body: <p>I've run into a weird issue on Terraform v 0.11.8. We are trying to close down the ports of ACR and make it available only in-network and also for the app-services access it.</p>
  
  <p>The terraform IP_restriction rules documentation shows something like this.</p>
  
  <pre><code>network_rule_set {
      default_action = "Deny"
      **ip_rule = [{
        action = "Allow"
        ip_range = "x.x.x.x"
      },
      {
        action = "Allow"
        ip_range = "y.y.y.y"
      }...]**
    }
  </code></pre>
  
  <p>I have list of IPs in my variable/local</p>
  
  <pre><code>variable "myIps" {
     type="list"
     default="[x.x.x.x, y.y.y.y, z.z.z.z, ....]"
  }
  </code></pre>
  
  <p>How do I convert the list of elements [x.x.x.x] into list of Objects with
  [{action = "Allow" ip_range = "x.x.x.x"}]. The first property action = "Allow" is always static. I have to pass the IP from my variable into the object property. </p>
  
  <p>I tried with regex pattern like</p>
  
  <pre><code>variable "test2" {
    type="string"
    default = "{action=\"Allow\", ip_range=\"%s\"}"
  }
  </code></pre>
  
  <p>but this returns string not the List of Objects.</p>
  
  <p>Thanks!</p>