title: Pass list of strings into a module and then create array Terraform
body: <p>I am currently creating a Terraform module that creates some ECS tasks. I want to be able to pass a list of commands so I can specify the command field for a certain task.</p>
  <p>I currently pass my list into my module like so:</p>
  <pre><code>module &quot;test&quot; {
    source = &quot;git@github.com:test/deploy.git&quot;
    task_count = 3
  
    entryPoints = [
      &quot;run, -c, /app/node/node_0, --bootnode, true&quot;,
      &quot;run, -c, /app/node/node_1&quot;,
      &quot;run, -c, /app/node/node_2&quot;,
    ]
  }
  </code></pre>
  <p>And then I want to pass each command into it's task here:</p>
  <pre><code>data &quot;template_file&quot; &quot;test&quot; {
    template = file(&quot;${path.module}/templates/test.json.tpl&quot;)
    count = var.task_count
  
    vars = {
      entryPoint = split(&quot;,&quot;, element(var.entryPoints, count.index)),
    }
  }
  </code></pre>
  <p>I was hoping <code>element(var.entryPoints, count.index)</code> meant for the first task it would pass in</p>
  <p><code>&quot;run&quot;, &quot;-c&quot;, &quot;/app/node/node_0&quot;, &quot;--bootnode&quot;, &quot;true&quot;</code></p>
  <p>Then for the second task</p>
  <p><code>&quot;run&quot;, &quot;-c&quot;, &quot;/app/node/node_1&quot;</code></p>
  <p>etc</p>
  <p>However, I'm receiving the error:</p>
  <pre><code>Error: Incorrect attribute value type
  
    on .terraform/modules/test/ecs_task_definition.tf line 5, in data &quot;template_file&quot; &quot;test&quot;:
     5:   vars = {
    12:   entryPoint = split(&quot;,&quot;, element(var.entryPoints, count.index)),
    15:   }
  
  Inappropriate value for attribute &quot;vars&quot;: element &quot;entryPoint&quot;: string
  required.
  </code></pre>