Skip to content

(aws-ecs): Add "none" log driver option for ECS containers #35795

@wladyslawczyzewski

Description

@wladyslawczyzewski

Describe the feature

While this is not explicitly mentioned in ECS document, we're able to use "none" as log driver for container if we don't want to collect any logs from it.

Use Case

Some infra setups may want to use OpenTelemetry logs sending functionally (collect logs via OTel), so collecting the same logs from the stdout/stderr is not necessary. For such cases, we need the ability to set the none driver for container.

For now, we can do that by escaping to L1 templates with:

    const taskDefinition = taskDefinition.node
      .defaultChild as ecs.CfnTaskDefinition;
    taskDefinition.addPropertyOverride(
      "ContainerDefinitions.0.LogConfiguration",
      {
        LogDriver: "none",
      }
    );

Proposed Solution

add none log driver to LogDriver class similary to already existed options

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS CDK Library version (aws-cdk-lib)

2.220.0

AWS CDK CLI version

2.1030.0

Environment details (OS name and version, etc.)

macOS 26.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecsRelated to Amazon Elastic Containereffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions