FireLensLogDriverProps

class aws_cdk.aws_ecs.FireLensLogDriverProps(*, env=None, env_regex=None, labels=None, tag=None, options=None, secret_options=None)

Bases: BaseLogDriverProps

Specifies the firelens log driver configuration options.

Parameters:
  • env (Optional[Sequence[str]]) – The env option takes an array of keys. If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message. Default: - No env

  • env_regex (Optional[str]) – The env-regex option is similar to and compatible with env. Its value is a regular expression to match logging-related environment variables. It is used for advanced log tag options. Default: - No envRegex

  • labels (Optional[Sequence[str]]) – The labels option takes an array of keys. If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message. Default: - No labels

  • tag (Optional[str]) – By default, Docker uses the first 12 characters of the container ID to tag log messages. Refer to the log tag option documentation for customizing the log tag format. Default: - The first 12 characters of the container ID

  • options (Optional[Mapping[str, str]]) – The configuration options to send to the log driver. Default: - the log driver options

  • secret_options (Optional[Mapping[str, Secret]]) – The secrets to pass to the log configuration. Default: - No secret options provided.

ExampleMetadata:

infused

Example:

# Create a Task Definition for the container to start
task_definition = ecs.Ec2TaskDefinition(self, "TaskDef")
task_definition.add_container("TheContainer",
    image=ecs.ContainerImage.from_registry("example-image"),
    memory_limit_mi_b=256,
    logging=ecs.LogDrivers.firelens(
        options={
            "Name": "firehose",
            "region": "us-west-2",
            "delivery_stream": "my-stream"
        }
    )
)

Attributes

env

The env option takes an array of keys.

If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.

Default:
  • No env

env_regex

The env-regex option is similar to and compatible with env.

Its value is a regular expression to match logging-related environment variables. It is used for advanced log tag options.

Default:
  • No envRegex

labels

The labels option takes an array of keys.

If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.

Default:
  • No labels

options

The configuration options to send to the log driver.

Default:
  • the log driver options

secret_options

The secrets to pass to the log configuration.

Default:
  • No secret options provided.

tag

By default, Docker uses the first 12 characters of the container ID to tag log messages.

Refer to the log tag option documentation for customizing the log tag format.

Default:
  • The first 12 characters of the container ID