日志驱动程序awslogs需要以下选项:awslogs-region,awslogs-group

时间:2020-06-20 18:35:19

标签: amazon-web-services containers terraform amazon-cloudwatch ecs-taskdefinition

我有一个AWS ECS Task definition的json文件,例如:

[
    {
      "name": "my-name",
      "image": "url",
      "cpu": 2,
      "dnsSearchDomains": null,
      "network_configuration":"awsvpc",
      "entryPoint": null,
      "portMappings": [
        {
          "hostPort": 8080,
          "protocol": "tcp",
          "containerPort": 8080
        }
      ],
      "command": null,
      "linuxParameters": null,
      "environment": [],
      "resourceRequirements": null,
      "ulimits": null,
      "dnsServers": null,
      "mountPoints": [
        {
          "readOnly": null,
          "containerPath": "/fldr",
          "sourceVolume": "fldr"
        }
      ],
      "workingDirectory": null,
      "secrets": null,
      "dockerSecurityOptions": null,
      "memoryReservation": 128,
      "volumesFrom": [],
      "stopTimeout": null,
      "startTimeout": null,
      "firelensConfiguration": null,
      "dependsOn": null,
      "disableNetworking": null,
      "interactive": null,
      "healthCheck": null,
      "essential": true,
      "links": null,
      "hostname": null,
      "extraHosts": null,
      "pseudoTerminal": null,
      "user": null,
      "readonlyRootFilesystem": null,
      "dockerLabels": null,
      "systemControls": null,
      "privileged": null,
      "logConfiguration": {
        "logDriver": "awslogs",
        "awslogs-region": "eu-west-1",
        "awslogs-group": "my-cw-group"
      }
    }
  ]

尽管定义awslogs-regionawslogs-group 像这样:

"logConfiguration": {
            "logDriver": "awslogs",
            "awslogs-region": "eu-west-1",
            "awslogs-group": "my-cw-group"
          }

当我运行terraform apply时,它返回:

Error: ClientException: Log driver awslogs requires options: awslogs-region, awslogs-group

我在Github中都找不到StackOverflow中的相关问题。

1 个答案:

答案 0 :(得分:1)

<uses-permission android:name="android.permission.INTERNET"/>

这些选项必须是 options 的成员,该选项是 logConfiguration 的成员,如上所示。

如果您使用Fargate,则还需要提供文档中Specifying a Log Configuration in your Task Definition中记录的 awslogs-stream-prefix