turnerlabs / fargate

Deploy serverless containers to the cloud from your command line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Task with container that has firelensConfiguration cannot be updated

mchastain-turner opened this issue · comments

to reproduce create a task with 2 container definitions. Add a firelensConfiguation to one. Try to update the primary app. result:

ClientException: When awsfirelens log driver is specified in log configuration, a firelens configuration object must be configured in one of the containers.
	status code: 400, request id: eb51c4dd-5eda-4005-8fcf-3b612a4864cf

something to do with how the TaskDefinitionOutput struct is being passed around. The base task is defined below:

  "containerDefinitions": [{
    "name": "app",
    "image": "whatever/image",
    "cpu": 0,
    "portMappings": [{
      "containerPort": 80,
      "hostPort": 80,
      "protocol": "tcp"
    }],
    "essential": true,
    "environment": [ {
      "name": "HEALTHCHECK",
      "value": "/_healthcheck"
    }, {
      "name": "LOG_LEVEL",
      "value": "info"
    }],
    "mountPoints": [],
    "volumesFrom": [],
    "secrets": [{
      "name": "MONGO_PASSWORD",
      "valueFrom": "arn:aws:ssm:us-east-1:287171731453:parameter/varys/dev/MONGO_PASSWORD"
    }, {
      "name": "MONGO_USER",
      "valueFrom": "arn:aws:ssm:us-east-1:287171731453:parameter/varys/dev/MONGO_USER"
    }],
    "logConfiguration": {
      "logDriver": "awsfirelens",
      "options": {
        "Name": "Http",
        "Host": "listener.logz.io",
        "URI": "/?token=secretSTring&type=fargate",
        "Port": "8071",
        "tls": "on",
        "tls.verify": "off",
        "Format": "json_lines"
      }
    }
  }, {
    "name": "logzio-log-router",
    "image": "amazon/aws-for-fluent-bit:latest",
    "essential": true,
    "firelensConfiguration": {
      "type": "fluentbit",
      "options": {
        "enable-ecs-log-metadata": "true"
      }
    },
     "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "/fargate/service/varys-dev",
          "awslogs-region": "us-east-1",
          "awslogs-stream-prefix": "ecs"
        }
    }
  }],
  "family": "varys-dev",
  "taskRoleArn": "arn:aws:iam::287171731453:role/varys-dev",
  "executionRoleArn": "arn:aws:iam::287171731453:role/varys-dev-ecs",
  "networkMode": "awsvpc",
  "volumes": [],
  "placementConstraints": [],
  "requiresCompatibilities": [
    "FARGATE"
  ],
  "cpu": "256",
  "memory": "512"
}