ContainerDefinitionOptions

class aws_cdk.aws_ecs.ContainerDefinitionOptions(*, image, command=None, cpu=None, disable_networking=None, dns_search_domains=None, dns_servers=None, docker_labels=None, docker_security_options=None, entry_point=None, environment=None, essential=None, extra_hosts=None, gpu_count=None, health_check=None, hostname=None, linux_parameters=None, logging=None, memory_limit_mib=None, memory_reservation_mib=None, privileged=None, readonly_root_filesystem=None, secrets=None, start_timeout=None, stop_timeout=None, user=None, working_directory=None)

Bases: object

__init__(*, image, command=None, cpu=None, disable_networking=None, dns_search_domains=None, dns_servers=None, docker_labels=None, docker_security_options=None, entry_point=None, environment=None, essential=None, extra_hosts=None, gpu_count=None, health_check=None, hostname=None, linux_parameters=None, logging=None, memory_limit_mib=None, memory_reservation_mib=None, privileged=None, readonly_root_filesystem=None, secrets=None, start_timeout=None, stop_timeout=None, user=None, working_directory=None)
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[List[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.

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

  • 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[List[str]]) – A list of DNS search domains that are presented to the container. Default: - No search domains.

  • dns_servers (Optional[List[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[List[str]]) – A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. Default: - No security labels.

  • entry_point (Optional[List[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.

  • 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 (Optional[HealthCheck]) – 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.

  • 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 paramters.

  • 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.

  • 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

  • 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

  • user (Optional[str]) – The user name to use inside the container. Default: root

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

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 :default: - CMD value built into container image.

Return type

Optional[List[str]]

cpu

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

default :default: - No minimum CPU units reserved.

Return type

Union[int, float, None]

disable_networking

Specifies whether networking is disabled within the container.

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

default :default: false

Return type

Optional[bool]

dns_search_domains

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

default :default: - No search domains.

Return type

Optional[List[str]]

dns_servers

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

default :default: - Default DNS servers.

Return type

Optional[List[str]]

docker_labels

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

default :default: - No labels.

Return type

Optional[Mapping[str, str]]

docker_security_options

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

default :default: - No security labels.

Return type

Optional[List[str]]

entry_point

The ENTRYPOINT value to pass to the container.

default :default: - Entry point configured in container.

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

Return type

Optional[List[str]]

environment

The environment variables to pass to the container.

default :default: - No environment variables.

Return type

Optional[Mapping[str, str]]

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 :default: true

Return type

Optional[bool]

extra_hosts

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

default :default: - No extra hosts.

Return type

Optional[Mapping[str, str]]

gpu_count

The number of GPUs assigned to the container.

default :default: - No GPUs assigned.

Return type

Union[int, float, None]

health_check

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

default :default: - Health check configuration from container.

Return type

Optional[HealthCheck]

hostname

The hostname to use for your container.

default :default: - Automatic hostname.

Return type

Optional[str]

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

Return type

ContainerImage

linux_parameters

//docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html>`_.

default :default: - No Linux paramters.

Type

Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more information see `KernelCapabilities <https

Return type

Optional[LinuxParameters]

logging

The log configuration specification for the container.

default :default: - Containers use the same logging driver that the Docker daemon uses.

Return type

Optional[LogDriver]

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 :default: - No memory limit.

Return type

Union[int, float, None]

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 :default: - No memory reserved.

Return type

Union[int, float, None]

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 :default: false

Return type

Optional[bool]

readonly_root_filesystem

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

default :default: false

Return type

Optional[bool]

secrets

The secret environment variables to pass to the container.

default :default: - No secret environment variables.

Return type

Optional[Mapping[str, Secret]]

start_timeout

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

default :default: - none

Return type

Optional[Duration]

stop_timeout

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

default :default: - none

Return type

Optional[Duration]

user

The user name to use inside the container.

default :default: root

Return type

Optional[str]

working_directory

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

default :default: /

Return type

Optional[str]