title: Is there a way to define multiple source_file for Terraform archive provider?
body: <p>I am using the <a href="https://www.terraform.io/docs/providers/archive/d/archive_file.html" rel="noreferrer">Terraform archive_file provider</a> to package multiple files into a zip file. It works fine when I define the archive like this:</p>
  
  <pre><code>data "archive_file" "archive" {
    type        = "zip"
    output_path = "./${var.name}.zip"
    source_dir  = "${var.source_dir}"
  }
  </code></pre>
  
  <p>However I don't want the archive to contain all of the files in <code>var.source_dir</code>, I only want a subset of them. I notice the archive_file provider has a <code>source_file</code> attribute so I was hoping I could supply a list of those files and package them into the archive like so:</p>
  
  <pre><code>locals {
    source_files = ["${var.source_dir}/foo.txt", "${var.source_dir}/bar.txt"]
  }
  
  data "archive_file" "archive" {
    type        = "zip"
    output_path = "./${var.name}.zip"
    count       = "2"
    source_file = "${local.source_files[count.index]}"
  }
  </code></pre>
  
  <p>but that doesn't work, the archive gets built for each file defined in <code>local.source-files</code> hence I have a "last one wins" scenario where the archive file that gets built only contains bar.txt.</p>
  
  <p>I tried this:</p>
  
  <pre><code>locals {
    source_files = ["${var.source_dir}/main.py", "${var.source_dir}/requirements.txt"]
  }
  
  data "archive_file" "archive" {
    type        = "zip"
    output_path = "./${var.name}.zip"
    source_file = "${local.source_files}"
  }
  </code></pre>
  
  <p>but unsurprisingly that failed with:</p>
  
  <blockquote>
    <p>data.archive_file.archive: source_file must be a single value, not a list</p>
  </blockquote>
  
  <p>Is there a way to achieve what I'm after here i.e pass a list of files to the archive_file provider and have it package all of them into the archive file?</p>