title: Adding multiple S3 paths to glue crawler with terraform
body: <p>I'm building out some infrastructure in AWS with Terraform. I have several S3 buckets created and want a Glue crawler to crawl these buckets once per hour. My Terraform Glue catalog db, role, and policy all build fine but when I try to create the crawler resource by adding four S3 paths to the <code>s3_target{}</code> portion of the crawler, I get a failure:</p>
  
  <pre><code>resource "aws_glue_crawler" "datalake_crawler" {
    database_name = "${var.glue_db_name}"
    name          = "${var.crawler_name}"
    role          = "${aws_iam_role.glue.id}" 
  
    s3_target {
  #    count = "${length(var.data_source_path)}"
      path = "${var.data_source_path}"#"${formatlist("%s", var.data_source_path)}"
    }
  }
  </code></pre>
  
  <p>This causes an error:</p>
  
  <pre><code>Error: aws_glue_crawler.datalake_crawler: s3_target.0.path must be a single value, not a list
  </code></pre>
  
  <p>I have tried adding a <code>count</code> statement in the <code>s3_target</code> but this fails. I have also tried adding </p>
  
  <pre><code>"${formatlist("%s", var.data_source_path)}"
  </code></pre>
  
  <p>in the <code>path</code> argument but this too fails.</p>
  
  <p>Can I add multiple <code>s3</code> paths to a Glue Crawler with Terraform? I can make this happen through the AWS console but this needs to be done using infrastructure as code.</p>