CannotCreateContainerError:地址

时间:2018-05-14 09:47:21

标签: amazon-web-services devops terraform

我正在尝试在ECS上设置fluentd日志记录容器。我有一个任务定义(截断)看起来像这样:

resource "aws_ecs_task_definition" "ecs_tooling_task_definition" {
  family = "${var.environment}-ecs_tooling_task_definition"

  container_definitions = <<DEFINITION
    [
            {
                "name": "tooling",
                "image": "myimage.dkr.ecr.eu-west-1.amazonaws.com/tooling:latest",
                "essential": true,
                "memory": 512,
                "cpu": 10,
                "portMappings": [
                    {
                        "containerPort": 24224,
                        "hostPort": 24224
                    }
                ],
                "logConfiguration": {
                "logDriver": "fluentd",
                "options": {
                    "fluentd-address":"https://fluentd-url:9090"
                }
              }
          }
        ]
DEFINITION
}

尝试启动容器时,会出现此错误:

CannotCreateContainerError: API error (400): invalid fluentd-address fluentd-url:9090: 
address fluentd-url:9090: too many colons in address

这是因为沿着这条线的某处,它在地址的末尾添加了一个冒号。

I've looked at the Docker docs以及指向fluentd-address的{​​{3}}并且没有端口参数。

发生了什么事?我不想用控制台来设置它。

1 个答案:

答案 0 :(得分:0)

删除https://前面的fluentd-address为我解决了这个问题:

"fluentd-address":"https://fluentd-url:9090"

"fluentd-address":"fluentd-url:9090"