CfnTaskDefinitionProps

class aws_cdk.aws_ecs.CfnTaskDefinitionProps(*, container_definitions=None, cpu=None, ephemeral_storage=None, execution_role_arn=None, family=None, inference_accelerators=None, ipc_mode=None, memory=None, network_mode=None, pid_mode=None, placement_constraints=None, proxy_configuration=None, requires_compatibilities=None, runtime_platform=None, tags=None, task_role_arn=None, volumes=None)

Bases: object

Properties for defining a AWS::ECS::TaskDefinition.

Parameters
  • container_definitions (Union[IResolvable, Sequence[Union[IResolvable, ContainerDefinitionProperty]], None]) – AWS::ECS::TaskDefinition.ContainerDefinitions.

  • cpu (Optional[str]) – AWS::ECS::TaskDefinition.Cpu.

  • ephemeral_storage (Union[IResolvable, EphemeralStorageProperty, None]) – AWS::ECS::TaskDefinition.EphemeralStorage.

  • execution_role_arn (Optional[str]) – AWS::ECS::TaskDefinition.ExecutionRoleArn.

  • family (Optional[str]) – AWS::ECS::TaskDefinition.Family.

  • inference_accelerators (Union[IResolvable, Sequence[Union[IResolvable, InferenceAcceleratorProperty]], None]) – AWS::ECS::TaskDefinition.InferenceAccelerators.

  • ipc_mode (Optional[str]) – AWS::ECS::TaskDefinition.IpcMode.

  • memory (Optional[str]) – AWS::ECS::TaskDefinition.Memory.

  • network_mode (Optional[str]) – AWS::ECS::TaskDefinition.NetworkMode.

  • pid_mode (Optional[str]) – AWS::ECS::TaskDefinition.PidMode.

  • placement_constraints (Union[IResolvable, Sequence[Union[IResolvable, TaskDefinitionPlacementConstraintProperty]], None]) – AWS::ECS::TaskDefinition.PlacementConstraints.

  • proxy_configuration (Union[IResolvable, ProxyConfigurationProperty, None]) – AWS::ECS::TaskDefinition.ProxyConfiguration.

  • requires_compatibilities (Optional[Sequence[str]]) – AWS::ECS::TaskDefinition.RequiresCompatibilities.

  • runtime_platform (Union[IResolvable, RuntimePlatformProperty, None]) – AWS::ECS::TaskDefinition.RuntimePlatform.

  • tags (Optional[Sequence[CfnTag]]) – AWS::ECS::TaskDefinition.Tags.

  • task_role_arn (Optional[str]) – AWS::ECS::TaskDefinition.TaskRoleArn.

  • volumes (Union[IResolvable, Sequence[Union[IResolvable, VolumeProperty]], None]) – AWS::ECS::TaskDefinition.Volumes.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html

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

cfn_task_definition_props = ecs.CfnTaskDefinitionProps(
    container_definitions=[ecs.CfnTaskDefinition.ContainerDefinitionProperty(
        command=["command"],
        cpu=123,
        depends_on=[ecs.CfnTaskDefinition.ContainerDependencyProperty(
            condition="condition",
            container_name="containerName"
        )],
        disable_networking=False,
        dns_search_domains=["dnsSearchDomains"],
        dns_servers=["dnsServers"],
        docker_labels={
            "docker_labels_key": "dockerLabels"
        },
        docker_security_options=["dockerSecurityOptions"],
        entry_point=["entryPoint"],
        environment=[ecs.CfnTaskDefinition.KeyValuePairProperty(
            name="name",
            value="value"
        )],
        environment_files=[ecs.CfnTaskDefinition.EnvironmentFileProperty(
            type="type",
            value="value"
        )],
        essential=False,
        extra_hosts=[ecs.CfnTaskDefinition.HostEntryProperty(
            hostname="hostname",
            ip_address="ipAddress"
        )],
        firelens_configuration=ecs.CfnTaskDefinition.FirelensConfigurationProperty(
            options={
                "options_key": "options"
            },
            type="type"
        ),
        health_check=ecs.CfnTaskDefinition.HealthCheckProperty(
            command=["command"],
            interval=123,
            retries=123,
            start_period=123,
            timeout=123
        ),
        hostname="hostname",
        image="image",
        interactive=False,
        links=["links"],
        linux_parameters=ecs.CfnTaskDefinition.LinuxParametersProperty(
            capabilities=ecs.CfnTaskDefinition.KernelCapabilitiesProperty(
                add=["add"],
                drop=["drop"]
            ),
            devices=[ecs.CfnTaskDefinition.DeviceProperty(
                container_path="containerPath",
                host_path="hostPath",
                permissions=["permissions"]
            )],
            init_process_enabled=False,
            max_swap=123,
            shared_memory_size=123,
            swappiness=123,
            tmpfs=[ecs.CfnTaskDefinition.TmpfsProperty(
                size=123,

                # the properties below are optional
                container_path="containerPath",
                mount_options=["mountOptions"]
            )]
        ),
        log_configuration=ecs.CfnTaskDefinition.LogConfigurationProperty(
            log_driver="logDriver",

            # the properties below are optional
            options={
                "options_key": "options"
            },
            secret_options=[ecs.CfnTaskDefinition.SecretProperty(
                name="name",
                value_from="valueFrom"
            )]
        ),
        memory=123,
        memory_reservation=123,
        mount_points=[ecs.CfnTaskDefinition.MountPointProperty(
            container_path="containerPath",
            read_only=False,
            source_volume="sourceVolume"
        )],
        name="name",
        port_mappings=[ecs.CfnTaskDefinition.PortMappingProperty(
            container_port=123,
            host_port=123,
            protocol="protocol"
        )],
        privileged=False,
        pseudo_terminal=False,
        readonly_root_filesystem=False,
        repository_credentials=ecs.CfnTaskDefinition.RepositoryCredentialsProperty(
            credentials_parameter="credentialsParameter"
        ),
        resource_requirements=[ecs.CfnTaskDefinition.ResourceRequirementProperty(
            type="type",
            value="value"
        )],
        secrets=[ecs.CfnTaskDefinition.SecretProperty(
            name="name",
            value_from="valueFrom"
        )],
        start_timeout=123,
        stop_timeout=123,
        system_controls=[ecs.CfnTaskDefinition.SystemControlProperty(
            namespace="namespace",
            value="value"
        )],
        ulimits=[ecs.CfnTaskDefinition.UlimitProperty(
            hard_limit=123,
            name="name",
            soft_limit=123
        )],
        user="user",
        volumes_from=[ecs.CfnTaskDefinition.VolumeFromProperty(
            read_only=False,
            source_container="sourceContainer"
        )],
        working_directory="workingDirectory"
    )],
    cpu="cpu",
    ephemeral_storage=ecs.CfnTaskDefinition.EphemeralStorageProperty(
        size_in_gi_b=123
    ),
    execution_role_arn="executionRoleArn",
    family="family",
    inference_accelerators=[ecs.CfnTaskDefinition.InferenceAcceleratorProperty(
        device_name="deviceName",
        device_type="deviceType"
    )],
    ipc_mode="ipcMode",
    memory="memory",
    network_mode="networkMode",
    pid_mode="pidMode",
    placement_constraints=[ecs.CfnTaskDefinition.TaskDefinitionPlacementConstraintProperty(
        type="type",

        # the properties below are optional
        expression="expression"
    )],
    proxy_configuration=ecs.CfnTaskDefinition.ProxyConfigurationProperty(
        container_name="containerName",

        # the properties below are optional
        proxy_configuration_properties=[ecs.CfnTaskDefinition.KeyValuePairProperty(
            name="name",
            value="value"
        )],
        type="type"
    ),
    requires_compatibilities=["requiresCompatibilities"],
    runtime_platform=ecs.CfnTaskDefinition.RuntimePlatformProperty(
        cpu_architecture="cpuArchitecture",
        operating_system_family="operatingSystemFamily"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    task_role_arn="taskRoleArn",
    volumes=[ecs.CfnTaskDefinition.VolumeProperty(
        docker_volume_configuration=ecs.CfnTaskDefinition.DockerVolumeConfigurationProperty(
            autoprovision=False,
            driver="driver",
            driver_opts={
                "driver_opts_key": "driverOpts"
            },
            labels={
                "labels_key": "labels"
            },
            scope="scope"
        ),
        efs_volume_configuration=ecs.CfnTaskDefinition.EfsVolumeConfigurationProperty(
            file_system_id="fileSystemId",

            # the properties below are optional
            authorization_config=ecs.CfnTaskDefinition.AuthorizationConfigProperty(
                access_point_id="accessPointId",
                iam="iam"
            ),
            root_directory="rootDirectory",
            transit_encryption="transitEncryption",
            transit_encryption_port=123
        ),
        host=ecs.CfnTaskDefinition.HostVolumePropertiesProperty(
            source_path="sourcePath"
        ),
        name="name"
    )]
)

Attributes

container_definitions

AWS::ECS::TaskDefinition.ContainerDefinitions.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-containerdefinitions

Return type

Union[IResolvable, List[Union[IResolvable, ContainerDefinitionProperty]], None]

cpu

AWS::ECS::TaskDefinition.Cpu.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-cpu

Return type

Optional[str]

ephemeral_storage

AWS::ECS::TaskDefinition.EphemeralStorage.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-ephemeralstorage

Return type

Union[IResolvable, EphemeralStorageProperty, None]

execution_role_arn

AWS::ECS::TaskDefinition.ExecutionRoleArn.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-executionrolearn

Return type

Optional[str]

family

AWS::ECS::TaskDefinition.Family.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-family

Return type

Optional[str]

inference_accelerators

AWS::ECS::TaskDefinition.InferenceAccelerators.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-inferenceaccelerators

Return type

Union[IResolvable, List[Union[IResolvable, InferenceAcceleratorProperty]], None]

ipc_mode

AWS::ECS::TaskDefinition.IpcMode.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-ipcmode

Return type

Optional[str]

memory

AWS::ECS::TaskDefinition.Memory.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-memory

Return type

Optional[str]

network_mode

AWS::ECS::TaskDefinition.NetworkMode.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-networkmode

Return type

Optional[str]

pid_mode

AWS::ECS::TaskDefinition.PidMode.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-pidmode

Return type

Optional[str]

placement_constraints

AWS::ECS::TaskDefinition.PlacementConstraints.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-placementconstraints

Return type

Union[IResolvable, List[Union[IResolvable, TaskDefinitionPlacementConstraintProperty]], None]

proxy_configuration

AWS::ECS::TaskDefinition.ProxyConfiguration.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-proxyconfiguration

Return type

Union[IResolvable, ProxyConfigurationProperty, None]

requires_compatibilities

AWS::ECS::TaskDefinition.RequiresCompatibilities.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-requirescompatibilities

Return type

Optional[List[str]]

runtime_platform

AWS::ECS::TaskDefinition.RuntimePlatform.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-runtimeplatform

Return type

Union[IResolvable, RuntimePlatformProperty, None]

tags

AWS::ECS::TaskDefinition.Tags.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-tags

Return type

Optional[List[CfnTag]]

task_role_arn

AWS::ECS::TaskDefinition.TaskRoleArn.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-taskrolearn

Return type

Optional[str]

volumes

AWS::ECS::TaskDefinition.Volumes.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-volumes

Return type

Union[IResolvable, List[Union[IResolvable, VolumeProperty]], None]