Hi, I am facing issue with container definition.
data "template_file" "env_vars" {
template = file("env_vars.json")
}
resource "aws_ecs_task_definition" "test" {
family = "test"
container_definitions = <<DEFINITION
[
{
"name" : "test",
"image" : "image",
cpu : 1,
"memory" : 2048,
"entrypoint" : ["bash", "-c"],
"command" : ["/bin/bash -c '/opt/run-master.sh'"],
"workingDirectory" : "/opt/airflow",
"essential" : true,
"environment" : ${data.template_file.env_vars.rendered},
"portMappings" : [
{
"containerPort" : 8080,
"hostPort" : 8080
},
{
"containerPort" : 5555,
"hostPort" : 5555
}
],
},
{
"name" : "rabbitmq",
"image" : "image",
"entrypoint" : ["bash", "-c"],
"command" : ["bash -c '/run/run.sh'"],
"memory" : 1024,
"essential" : true,
"cpu" : 1,
"portMappings" : [
{
"containerPort" : 5672,
"hostPort" : 5672
},
{
"containerPort" : 15672
"hostPort" : 15672
}
],
}
]
DEFINITION
during terraform plan
│ Error: ECS Task Definition container_definitions is invalid: Error decoding JSON: invalid character 'c' looking for beginning of object key string
Unable figure out the issue.