title: for each in terraform - pick values from text file
body: <p>I have a <code>null_resource</code> in my script as follows and I have a text file in which i get the <code>port</code> no, like below</p>
  <pre><code>40000
  40001
  </code></pre>
  <pre><code>resource &quot;null_resource&quot; &quot;opsfile&quot; {   
    provisioner &quot;file&quot; {
      source      = &quot;${path.module}/../../configfiles/file1.yaml&quot;
      destination = &quot;/home/file1.yaml&quot;    
      connection {
          type = &quot;ssh&quot;
          user = &quot;newus&quot;        
          host = &quot;var.publicip
          port = // i want to call each port in that text file here
          
        }
        
   }
  </code></pre>
  <p>How can i access the ports one by one and get the script to connect to that port,  any help would be appreciated.</p>