-
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
The multiple-containers
example doesn't work after adding the additional_containers
variable since it's used as such:
resource "aws_ecs_task_definition" "td" {
container_definitions = jsonencode(concat(var.additional_containers, [module.container_definition.json_map_object]))
...
Only specifying additional_containers
and not specifying the container directly makes us concat the additional_containers
with essentially {}
, which isn't a valid task definition. This gives the error:
Error: creating ECS Task Definition (my-td): operation error ECS: RegisterTaskDefinition, https response error StatusCode: 400, RequestID: 607d430b-b0ca-49c1-9ae3-c1f30ba8320d, ClientException: Container.name should not be null or empty.
│
│ with module.app.module.backend-service.module.ecs-fargate-task-definition["migration"].aws_ecs_task_definition.td,
│ on .terraform/modules/app.backend-service.ecs-fargate-task-definition/main.tf line 85, in resource "aws_ecs_task_definition" "td":
│ 85: resource "aws_ecs_task_definition" "td" {
This should check to see if module.container_definition.json_map_object
is "empty" before adding it to the container_definitions
.
Metadata
Metadata
Assignees
Labels
No labels