FirelensLogRouterDefinitionOptions

class aws_cdk.aws_ecs.FirelensLogRouterDefinitionOptions(*, image, command=None, container_name=None, cpu=None, credential_specs=None, disable_networking=None, dns_search_domains=None, dns_servers=None, docker_labels=None, docker_security_options=None, entry_point=None, environment=None, environment_files=None, essential=None, extra_hosts=None, gpu_count=None, health_check=None, hostname=None, inference_accelerator_resources=None, interactive=None, linux_parameters=None, logging=None, memory_limit_mib=None, memory_reservation_mib=None, port_mappings=None, privileged=None, pseudo_terminal=None, readonly_root_filesystem=None, secrets=None, start_timeout=None, stop_timeout=None, system_controls=None, ulimits=None, user=None, working_directory=None, firelens_config)

Bases: ContainerDefinitionOptions

The options for creating a firelens log router.

Parameters:
  • image (ContainerImage) – The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. TODO: Update these to specify using classes of IContainerImage

  • command (Optional[Sequence[str]]) – The command that is passed to the container. If you provide a shell command as a single string, you have to quote command-line arguments. Default: - CMD value built into container image.

  • container_name (Optional[str]) – The name of the container. Default: - id of node associated with ContainerDefinition.

  • cpu (Union[int, float, None]) – The minimum number of CPU units to reserve for the container. Default: - No minimum CPU units reserved.

  • credential_specs (Optional[Sequence[CredentialSpec]]) – A list of ARNs in SSM or Amazon S3 to a credential spec (CredSpec) file that configures the container for Active Directory authentication. We recommend that you use this parameter instead of the dockerSecurityOptions. Currently, only one credential spec is allowed per container definition. Default: - No credential specs.

  • disable_networking (Optional[bool]) – Specifies whether networking is disabled within the container. When this parameter is true, networking is disabled within the container. Default: false

  • dns_search_domains (Optional[Sequence[str]]) – A list of DNS search domains that are presented to the container. Default: - No search domains.

  • dns_servers (Optional[Sequence[str]]) – A list of DNS servers that are presented to the container. Default: - Default DNS servers.

  • docker_labels (Optional[Mapping[str, str]]) – A key/value map of labels to add to the container. Default: - No labels.

  • docker_security_options (Optional[Sequence[str]]) – A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. Default: - No security labels.

  • entry_point (Optional[Sequence[str]]) – The ENTRYPOINT value to pass to the container. Default: - Entry point configured in container.

  • environment (Optional[Mapping[str, str]]) – The environment variables to pass to the container. Default: - No environment variables.

  • environment_files (Optional[Sequence[EnvironmentFile]]) – The environment files to pass to the container. Default: - No environment files.

  • essential (Optional[bool]) – Specifies whether the container is marked essential. If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task. All tasks must have at least one essential container. If this parameter is omitted, a container is assumed to be essential. Default: true

  • extra_hosts (Optional[Mapping[str, str]]) – A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. Default: - No extra hosts.

  • gpu_count (Union[int, float, None]) – The number of GPUs assigned to the container. Default: - No GPUs assigned.

  • health_check (Union[HealthCheck, Dict[str, Any], None]) – The health check command and associated configuration parameters for the container. Default: - Health check configuration from container.

  • hostname (Optional[str]) – The hostname to use for your container. Default: - Automatic hostname.

  • inference_accelerator_resources (Optional[Sequence[str]]) – The inference accelerators referenced by the container. Default: - No inference accelerators assigned.

  • interactive (Optional[bool]) – When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated. Default: - false

  • linux_parameters (Optional[LinuxParameters]) – Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more information see KernelCapabilities. Default: - No Linux parameters.

  • logging (Optional[LogDriver]) – The log configuration specification for the container. Default: - Containers use the same logging driver that the Docker daemon uses.

  • memory_limit_mib (Union[int, float, None]) – The amount (in MiB) of memory to present to the container. If your container attempts to exceed the allocated memory, the container is terminated. At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. Default: - No memory limit.

  • memory_reservation_mib (Union[int, float, None]) – The soft limit (in MiB) of memory to reserve for the container. When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first. At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. Default: - No memory reserved.

  • port_mappings (Optional[Sequence[Union[PortMapping, Dict[str, Any]]]]) – The port mappings to add to the container definition. Default: - No ports are mapped.

  • privileged (Optional[bool]) – Specifies whether the container is marked as privileged. When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). Default: false

  • pseudo_terminal (Optional[bool]) – When this parameter is true, a TTY is allocated. This parameter maps to Tty in the “Create a container section” of the Docker Remote API and the –tty option to docker run. Default: - false

  • readonly_root_filesystem (Optional[bool]) – When this parameter is true, the container is given read-only access to its root file system. Default: false

  • secrets (Optional[Mapping[str, Secret]]) – The secret environment variables to pass to the container. Default: - No secret environment variables.

  • start_timeout (Optional[Duration]) – Time duration (in seconds) to wait before giving up on resolving dependencies for a container. Default: - none

  • stop_timeout (Optional[Duration]) – Time duration (in seconds) to wait before the container is forcefully killed if it doesn’t exit normally on its own. Default: - none

  • system_controls (Optional[Sequence[Union[SystemControl, Dict[str, Any]]]]) – A list of namespaced kernel parameters to set in the container. Default: - No system controls are set.

  • ulimits (Optional[Sequence[Union[Ulimit, Dict[str, Any]]]]) – An array of ulimits to set in the container.

  • user (Optional[str]) – The user to use inside the container. This parameter maps to User in the Create a container section of the Docker Remote API and the –user option to docker run. Default: root

  • working_directory (Optional[str]) – The working directory in which to run commands inside the container. Default: /

  • firelens_config (Union[FirelensConfig, Dict[str, Any]]) – Firelens configuration.

ExampleMetadata:

fixture=_generated

Example:

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

# app_protocol: ecs.AppProtocol
# container_image: ecs.ContainerImage
# credential_spec: ecs.CredentialSpec
# environment_file: ecs.EnvironmentFile
# linux_parameters: ecs.LinuxParameters
# log_driver: ecs.LogDriver
# secret: ecs.Secret

firelens_log_router_definition_options = ecs.FirelensLogRouterDefinitionOptions(
    firelens_config=ecs.FirelensConfig(
        type=ecs.FirelensLogRouterType.FLUENTBIT,

        # the properties below are optional
        options=ecs.FirelensOptions(
            config_file_type=ecs.FirelensConfigFileType.S3,
            config_file_value="configFileValue",
            enable_eCSLog_metadata=False
        )
    ),
    image=container_image,

    # the properties below are optional
    command=["command"],
    container_name="containerName",
    cpu=123,
    credential_specs=[credential_spec],
    disable_networking=False,
    dns_search_domains=["dnsSearchDomains"],
    dns_servers=["dnsServers"],
    docker_labels={
        "docker_labels_key": "dockerLabels"
    },
    docker_security_options=["dockerSecurityOptions"],
    entry_point=["entryPoint"],
    environment={
        "environment_key": "environment"
    },
    environment_files=[environment_file],
    essential=False,
    extra_hosts={
        "extra_hosts_key": "extraHosts"
    },
    gpu_count=123,
    health_check=ecs.HealthCheck(
        command=["command"],

        # the properties below are optional
        interval=cdk.Duration.minutes(30),
        retries=123,
        start_period=cdk.Duration.minutes(30),
        timeout=cdk.Duration.minutes(30)
    ),
    hostname="hostname",
    inference_accelerator_resources=["inferenceAcceleratorResources"],
    interactive=False,
    linux_parameters=linux_parameters,
    logging=log_driver,
    memory_limit_mi_b=123,
    memory_reservation_mi_b=123,
    port_mappings=[ecs.PortMapping(
        container_port=123,

        # the properties below are optional
        app_protocol=app_protocol,
        container_port_range="containerPortRange",
        host_port=123,
        name="name",
        protocol=ecs.Protocol.TCP
    )],
    privileged=False,
    pseudo_terminal=False,
    readonly_root_filesystem=False,
    secrets={
        "secrets_key": secret
    },
    start_timeout=cdk.Duration.minutes(30),
    stop_timeout=cdk.Duration.minutes(30),
    system_controls=[ecs.SystemControl(
        namespace="namespace",
        value="value"
    )],
    ulimits=[ecs.Ulimit(
        hard_limit=123,
        name=ecs.UlimitName.CORE,
        soft_limit=123
    )],
    user="user",
    working_directory="workingDirectory"
)

Attributes

command

The command that is passed to the container.

If you provide a shell command as a single string, you have to quote command-line arguments.

Default:
  • CMD value built into container image.

container_name

The name of the container.

Default:
  • id of node associated with ContainerDefinition.

cpu

The minimum number of CPU units to reserve for the container.

Default:
  • No minimum CPU units reserved.

credential_specs

A list of ARNs in SSM or Amazon S3 to a credential spec (CredSpec) file that configures the container for Active Directory authentication.

We recommend that you use this parameter instead of the dockerSecurityOptions.

Currently, only one credential spec is allowed per container definition.

Default:
  • No credential specs.

disable_networking

Specifies whether networking is disabled within the container.

When this parameter is true, networking is disabled within the container.

Default:

false

dns_search_domains

A list of DNS search domains that are presented to the container.

Default:
  • No search domains.

dns_servers

A list of DNS servers that are presented to the container.

Default:
  • Default DNS servers.

docker_labels

A key/value map of labels to add to the container.

Default:
  • No labels.

docker_security_options

A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.

Default:
  • No security labels.

entry_point

The ENTRYPOINT value to pass to the container.

Default:
  • Entry point configured in container.

See:

https://docs.docker.com/engine/reference/builder/#entrypoint

environment

The environment variables to pass to the container.

Default:
  • No environment variables.

environment_files

The environment files to pass to the container.

Default:
  • No environment files.

See:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html

essential

Specifies whether the container is marked essential.

If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task. All tasks must have at least one essential container.

If this parameter is omitted, a container is assumed to be essential.

Default:

true

extra_hosts

A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.

Default:
  • No extra hosts.

firelens_config

Firelens configuration.

gpu_count

The number of GPUs assigned to the container.

Default:
  • No GPUs assigned.

health_check

The health check command and associated configuration parameters for the container.

Default:
  • Health check configuration from container.

hostname

The hostname to use for your container.

Default:
  • Automatic hostname.

image

The image used to start a container.

This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. TODO: Update these to specify using classes of IContainerImage

inference_accelerator_resources

The inference accelerators referenced by the container.

Default:
  • No inference accelerators assigned.

interactive

When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated.

Default:
  • false

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-interactive

linux_parameters

Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.

For more information see KernelCapabilities.

Default:
  • No Linux parameters.

logging

The log configuration specification for the container.

Default:
  • Containers use the same logging driver that the Docker daemon uses.

memory_limit_mib

The amount (in MiB) of memory to present to the container.

If your container attempts to exceed the allocated memory, the container is terminated.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Default:
  • No memory limit.

memory_reservation_mib

The soft limit (in MiB) of memory to reserve for the container.

When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Default:
  • No memory reserved.

port_mappings

The port mappings to add to the container definition.

Default:
  • No ports are mapped.

privileged

Specifies whether the container is marked as privileged.

When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).

Default:

false

pseudo_terminal

When this parameter is true, a TTY is allocated.

This parameter maps to Tty in the “Create a container section” of the Docker Remote API and the –tty option to docker run.

Default:
  • false

See:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_pseudoterminal

readonly_root_filesystem

When this parameter is true, the container is given read-only access to its root file system.

Default:

false

secrets

The secret environment variables to pass to the container.

Default:
  • No secret environment variables.

start_timeout

Time duration (in seconds) to wait before giving up on resolving dependencies for a container.

Default:
  • none

stop_timeout

Time duration (in seconds) to wait before the container is forcefully killed if it doesn’t exit normally on its own.

Default:
  • none

system_controls

A list of namespaced kernel parameters to set in the container.

Default:
  • No system controls are set.

See:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_systemcontrols

ulimits

An array of ulimits to set in the container.

user

The user to use inside the container.

This parameter maps to User in the Create a container section of the Docker Remote API and the –user option to docker run.

Default:

root

See:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#ContainerDefinition-user

working_directory

The working directory in which to run commands inside the container.

Default:

/