Terraform 12 Help build complex type variable ECS task definition json

I need to build json object for aws container task definition
output.tf

output "json" {
  description = "Container definition in JSON format"
 value = jsonencode([{
    name=var.name
    image=var.image
    memoryReservation=var.mem_soft_limit
    portMappings=replace(jsonencode(var.port_mappings), "/\"(?P<port>\\d+)\"/", "$port")
    cpu=var.cpu
    essential=var.essential
    entryPoint=var.entry_point
    command=var.command
    environment=var.environment
    links=var.links
    secrets=var.secrets
    ulimits=var.ulimits
    healthCheck=var.container_health_check
    mountPoints="[]"
    volumesFrom="[]"
    workingDirectory=var.working_directory
    logConfiguration = {
      logDriver="awslogs",
        "options": {
          "awslogs-group": var.log_group_name,
          "awslogs-stream-prefix": var.log_stream_prefix == "" ? var.name : var.log_stream_prefix,
          "awslogs-region": data.aws_region.current.name
      }
    }
  }])
}   

variable.tf

variable "container_health_check" {
  description = <<EOF
    A test to perform to check that the container is healthy. Applies when service is not behind LB.
    Example:
    "Healthcheck":{
    "Test":
    [
        "string"
    ],
    "Interval": 0,
    "Timeout": 0,
    "Retries": 0,
    "StartPeriod": 0

}
Where Test:

string

The test to perform. Possible values are:

    [] inherit healthcheck from image or parent image
    ["NONE"] disable healthcheck
    ["CMD", args...] exec arguments directly
    ["CMD-SHELL", command] run command with system's default shell


  EOF
  type    = map(object({command=list(string), interval=number, timeout=number, retries=number, startPeriod=number}))
  #type = "map"
}

main.tf

module “ecs_task” {
container_health_check = {
command=[“CMD-SHELL”, “celery inspect ping -A api_gateway.extensions:celery”],
interval=30,
timeout=5,
retries=3,
startPeriod=0
}
}

During plan got error

 on main.tf line 773, in module "api_microservice":
     773:   container_health_check = {
     774:     command=["CMD-SHELL", "celery inspect ping -A api_gateway.extensions:celery"],
     775:     interval=30,
     776:     timeout=5,
     777:     retries=3,
     778:     startPeriod=0
     779:   }
The given value is not suitable for child module variable
"container_health_check" defined at modules/microservice/variable.tf:232,1-34:
element "retries": object required.

Seems like I solved via remove from variable type “map”
Before:

type = map(object({command=list(string), interval=number, timeout=number, retries=number, startPeriod=number}))

After:

type = object({command=list(string), interval=number, timeout=number, retries=number, startPeriod=number})