I’m building an EMR cluster in Terraform and in the STEP argument i want to load a JSON file that describes the list of steps.
I tried this in my main.tf :
ressource "aws_emr" "emr" {
...
...
step = "${data.template_file.steps.rendered}"
}
data "template_file" "steps" {
template = "${file("${path.module}/steps.json")}"
}
And this is the JSON file :
[
{
"action_on_failure" : "CONTINUE",
"name" : "step_name",
"hadoop_jar_step" : {
"jar" : "command-runner.jar",
"args" : [
"spark-submit",
"s3://mybucket/src/pyspark/script1.py",
"1",
"68465131321321",
"s3://mybucket/parquet",
"s3://mybucket/result",
"321",
"65165165468587",
"654"
]
}
}
]
But when i do terraform plan i got this error :
Inappropriate value for attribute “step”: list of object required.
What’s the problem ?
Thanks for your help.