'Creating multiple Glue Jobs in Terraform

I am not able to create multiple Glue Jobs through Terraform. I am trying to do a count for jobname using count but when I try to do the same for job s3 script path its saying only string or single allowed." command.0.script_location must be a single value, not a list "

I tried playing around count order but looks like for every count name its creating 2 paths

resource "aws_glue_job" "glue_ETL_jobs" {
  count = "${length(var.jobnames)}"
  count = "${length(var.script_location)}"
  name     ="${var.jobnames[count.index]}_glueETLjob"
  role_arn = "${var.ETLjob_glue_role}"
  command {
    script_location = ["${var.script_location[count.index]}"]
  }
  default_arguments = {
    "--job-language" = "${var.job_language}"
    "--job-bookmark-option" = "${var.job_bookmark_option}"
    "--TempDir" = "${var.tempdirectory}"
    "--enable-continuous-cloudwatch-log" = "${var.cloud_watch_logging}"
    "--enable-continuous-log-filter" = "${var.continuous_log_filter}"
    "--max-capacity" = "${var.max-capacity}"
  }
}

as give abv

  name="${var.jobnames[count.index]}_glueETLjob"

  script_location = ["${var.script_location[count.index]}"]


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source