NetworkLoadBalancedTaskImageOptions

class aws_cdk.aws_ecs_patterns.NetworkLoadBalancedTaskImageOptions(*, image, container_name=None, container_port=None, enable_logging=None, environment=None, execution_role=None, family=None, log_driver=None, secrets=None, task_role=None)

Bases: object

__init__(*, image, container_name=None, container_port=None, enable_logging=None, environment=None, execution_role=None, family=None, log_driver=None, secrets=None, task_role=None)
Parameters
  • image (ContainerImage) – The image used to start a container. Image or taskDefinition must be specified, but not both. Default: - none

  • container_name (Optional[str]) – The container name value to be specified in the task definition. Default: - none

  • container_port (Union[int, float, None]) – The port number on the container that is bound to the user-specified or automatically assigned host port. If you are using containers in a task with the awsvpc or host network mode, exposed ports should be specified using containerPort. If you are using containers in a task with the bridge network mode and you specify a container port and not a host port, your container automatically receives a host port in the ephemeral port range. Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance. For more information, see hostPort. Default: 80

  • enable_logging (Optional[bool]) – Flag to indicate whether to enable logging. Default: true

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

  • execution_role (Optional[IRole]) – The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf. Default: - No value

  • family (Optional[str]) – The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.

  • log_driver (Optional[LogDriver]) – The log driver to use. Default: - AwsLogDriver if enableLogging is true

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

  • task_role (Optional[IRole]) – The name of the task IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: - A task role is automatically created for you.

Return type

None

Attributes

container_name

The container name value to be specified in the task definition.

default :default: - none

Return type

Optional[str]

container_port

The port number on the container that is bound to the user-specified or automatically assigned host port.

If you are using containers in a task with the awsvpc or host network mode, exposed ports should be specified using containerPort. If you are using containers in a task with the bridge network mode and you specify a container port and not a host port, your container automatically receives a host port in the ephemeral port range.

Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance.

For more information, see hostPort.

default :default: 80

Return type

Union[int, float, None]

enable_logging

Flag to indicate whether to enable logging.

default :default: true

Return type

Optional[bool]

environment

The environment variables to pass to the container.

default :default: - No environment variables.

Return type

Optional[Mapping[str, str]]

execution_role

The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf.

default :default: - No value

Return type

Optional[IRole]

family

The name of a family that this task definition is registered to.

A family groups multiple versions of a task definition.

default :default: - Automatically generated name.

Return type

Optional[str]

image

The image used to start a container.

Image or taskDefinition must be specified, but not both.

default :default: - none

Return type

ContainerImage

log_driver

The log driver to use.

default :default: - AwsLogDriver if enableLogging is true

Return type

Optional[LogDriver]

secrets

The secret to expose to the container as an environment variable.

default :default: - No secret environment variables.

Return type

Optional[Mapping[str, Secret]]

task_role

The name of the task IAM role that grants containers in the task permission to call AWS APIs on your behalf.

default :default: - A task role is automatically created for you.

Return type

Optional[IRole]