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
For me, I labeled the environment variable key incorrectly:
{ "key": "myvariable", "value": "myvalue" }
instead of
{ "name": "myvariable", "value": "myvalue" }
The difference is that I wrote key
instead of name
and that broke the whole container definition, which gave me this error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With