/cdk-fluentd-log-driver

experimental: AWS-CDK library for fluentd log driver on ECS

Primary LanguageTypeScriptApache License 2.0Apache-2.0

cdk-fluentd-log-driver

Build Status

cdk-fluentd-log-driver provides helper function that uses fluentd log driver to your ECS task definition.

Synopsis

import { ContainerImage, Ec2TaskDefinition } from "@aws-cdk/aws-ecs"
import { Stack } from "@aws-cdk/core";
import { FluentdLogDriver } from "@cohalz/cdk-fluentd-log-driver";

const stack = new Stack()
const taskDefinition = new Ec2TaskDefinition(stack, "TaskDefinition")

const logDriver = new FluentdLogDriver({
  fluentdAddress: "127.0.0.1:24224",
  fluentdMaxRetries: "3",
  fluentdRetryWait: "2",
  tag: "tag",
})

taskDefinition.addContainer("Container", {
  image: ContainerImage.fromRegistry("/aws/aws-example-app"),
  memoryLimitMiB: 2048,
  // Use a fluentd log driver
  logging: logDriver,
})

For available options, please refer to the docker docs.