We are using terraform to import a ECS solution and for some reason, I can not get pass this error.
aws_ecs_task_definition.clustername: ClientException: Container.name should not be null or empty. 09-Feb-2017 23:35:1 status code: 400
I believe this is coming form this json file, service-prod-server.json
#aws_ecs_task_definition
resource "aws_ecs_task_definition" "cluster-name" {
family = "cluster-name"
container_definitions = "${file("task-definitions/service-prod-server.json")}"
}
Here is the top portion of the service-prod-server.json config. I have the name there.
[
{
"name": "containername",
"memory": 7000,
"image": "imagename",
"disableNetworking": false,
"readonlyRootFilesystem": false,
I also have this config defined as well.
#aws_ecs_container_definition
data "aws_ecs_container_definition" "cluster-name" {
task_definition = "${aws_ecs_task_definition.cluster-name.id}"
container_name = "containername"
}
Let me know what you guys think
service-prod-server.json
config (omitting any secret stuff you may have there)? That might help us reproducing the error.