CommonTaskDefinitionAttributes

class aws_cdk.aws_ecs.CommonTaskDefinitionAttributes(*, network_mode=None, task_definition_arn, task_role=None)

Bases: object

The common task definition attributes used across all types of task definitions.

Parameters
  • network_mode (Optional[NetworkMode]) – The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.

  • task_definition_arn (str) – The arn of the task definition.

  • task_role (Optional[IRole]) – The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.

Example:

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

# role is of type Role

common_task_definition_attributes = ecs.CommonTaskDefinitionAttributes(
    task_definition_arn="taskDefinitionArn",

    # the properties below are optional
    network_mode=ecs.NetworkMode.NONE,
    task_role=role
)

Attributes

network_mode

The networking mode to use for the containers in the task.

Default

Network mode cannot be provided to the imported task.

Return type

Optional[NetworkMode]

task_definition_arn

The arn of the task definition.

Return type

str

task_role

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

Default

Permissions cannot be granted to the imported task.

Return type

Optional[IRole]