LogDriverConfig

class aws_cdk.aws_ecs.LogDriverConfig(*, log_driver, options=None, secret_options=None)

Bases: object

The configuration to use when creating a log driver.

Parameters:
  • log_driver (str) – The log driver to use for the container. The valid values listed for this parameter are log drivers that the Amazon ECS container agent can communicate with by default. For tasks using the Fargate launch type, the supported log drivers are awslogs, splunk, and awsfirelens. For tasks using the EC2 launch type, the supported log drivers are awslogs, fluentd, gelf, json-file, journald, logentries,syslog, splunk, and awsfirelens. For more information about using the awslogs log driver, see Using the awslogs Log Driver in the Amazon Elastic Container Service Developer Guide. For more information about using the awsfirelens log driver, see Custom Log Routing in the Amazon Elastic Container Service Developer Guide.

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

  • secret_options (Optional[Sequence[Union[SecretProperty, Dict[str, Any]]]]) – The secrets to pass to the log configuration. Default: - No secret options provided.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs

log_driver_config = ecs.LogDriverConfig(
    log_driver="logDriver",

    # the properties below are optional
    options={
        "options_key": "options"
    },
    secret_options=[ecs.CfnTaskDefinition.SecretProperty(
        name="name",
        value_from="valueFrom"
    )]
)

Attributes

log_driver

The log driver to use for the container.

The valid values listed for this parameter are log drivers that the Amazon ECS container agent can communicate with by default.

For tasks using the Fargate launch type, the supported log drivers are awslogs, splunk, and awsfirelens. For tasks using the EC2 launch type, the supported log drivers are awslogs, fluentd, gelf, json-file, journald, logentries,syslog, splunk, and awsfirelens.

For more information about using the awslogs log driver, see Using the awslogs Log Driver in the Amazon Elastic Container Service Developer Guide.

For more information about using the awsfirelens log driver, see Custom Log Routing in the Amazon Elastic Container Service Developer Guide.

options

The configuration options to send to the log driver.

secret_options

The secrets to pass to the log configuration.

Default:
  • No secret options provided.