我无法通过Terraform创建多个胶水作业。我正在尝试使用count对作业名进行计数,但是当我尝试对作业s3脚本路径执行相同的操作时,它只说字符串或允许单个。“ command.0.script_location必须是单个值,而不是列表 “
我尝试按计数顺序进行操作,但是看起来每个计数名称都会创建2条路径
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}"
}
}
提供abv
name="${var.jobnames[count.index]}_glueETLjob"
script_location = ["${var.script_location[count.index]}"]