RunEcsFargateTaskProps

class aws_cdk.aws_stepfunctions_tasks.RunEcsFargateTaskProps(*, cluster, container_overrides=None, integration_pattern=None, task_definition, assign_public_ip=None, platform_version=None, security_group=None, subnets=None)

Bases: aws_cdk.aws_stepfunctions_tasks.CommonEcsRunTaskProps

(deprecated) Properties to define an ECS service.

Parameters
  • cluster (ICluster) – The topic to run the task on.

  • container_overrides (Optional[Sequence[ContainerOverride]]) – Container setting overrides. Key is the name of the container to override, value is the values you want to override. Default: - No overrides

  • integration_pattern (Optional[ServiceIntegrationPattern]) – The service integration pattern indicates different ways to call RunTask in ECS. The valid value for Lambda is FIRE_AND_FORGET, SYNC and WAIT_FOR_TASK_TOKEN. Default: FIRE_AND_FORGET

  • task_definition (TaskDefinition) – Task Definition used for running tasks in the service. Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions

  • assign_public_ip (Optional[bool]) – (deprecated) Assign public IP addresses to each task. Default: false

  • platform_version (Optional[FargatePlatformVersion]) – (deprecated) Fargate platform version to run this service on. Unless you have specific compatibility requirements, you don’t need to specify this. Default: Latest

  • security_group (Optional[ISecurityGroup]) – (deprecated) Existing security group to use for the tasks. Default: A new security group is created

  • subnets (Optional[SubnetSelection]) – (deprecated) In what subnets to place the task’s ENIs. Default: Private subnet if assignPublicIp, public subnets otherwise

Deprecated

replaced by EcsRunTask and EcsRunTaskProps

Stability

deprecated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_ecs as ecs
import aws_cdk.aws_stepfunctions as stepfunctions
import aws_cdk.aws_stepfunctions_tasks as stepfunctions_tasks

# cluster is of type Cluster
# container_definition is of type ContainerDefinition
# security_group is of type SecurityGroup
# subnet is of type Subnet
# subnet_filter is of type SubnetFilter
# task_definition is of type TaskDefinition

run_ecs_fargate_task_props = stepfunctions_tasks.RunEcsFargateTaskProps(
    cluster=cluster,
    task_definition=task_definition,

    # the properties below are optional
    assign_public_ip=False,
    container_overrides=[stepfunctions_tasks.ContainerOverride(
        container_definition=container_definition,

        # the properties below are optional
        command=["command"],
        cpu=123,
        environment=[stepfunctions_tasks.TaskEnvironmentVariable(
            name="name",
            value="value"
        )],
        memory_limit=123,
        memory_reservation=123
    )],
    integration_pattern=stepfunctions.ServiceIntegrationPattern.FIRE_AND_FORGET,
    platform_version=ecs.FargatePlatformVersion.LATEST,
    security_group=security_group,
    subnets=ec2.SubnetSelection(
        availability_zones=["availabilityZones"],
        one_per_az=False,
        subnet_filters=[subnet_filter],
        subnet_group_name="subnetGroupName",
        subnet_name="subnetName",
        subnets=[subnet],
        subnet_type=ec2.SubnetType.ISOLATED
    )
)

Attributes

assign_public_ip

(deprecated) Assign public IP addresses to each task.

Default

false

Stability

deprecated

Return type

Optional[bool]

cluster

The topic to run the task on.

Return type

ICluster

container_overrides

Container setting overrides.

Key is the name of the container to override, value is the values you want to override.

Default
  • No overrides

Return type

Optional[List[ContainerOverride]]

integration_pattern

The service integration pattern indicates different ways to call RunTask in ECS.

The valid value for Lambda is FIRE_AND_FORGET, SYNC and WAIT_FOR_TASK_TOKEN.

Default

FIRE_AND_FORGET

Return type

Optional[ServiceIntegrationPattern]

platform_version

(deprecated) Fargate platform version to run this service on.

Unless you have specific compatibility requirements, you don’t need to specify this.

Default

Latest

Stability

deprecated

Return type

Optional[FargatePlatformVersion]

security_group

(deprecated) Existing security group to use for the tasks.

Default

A new security group is created

Stability

deprecated

Return type

Optional[ISecurityGroup]

subnets

(deprecated) In what subnets to place the task’s ENIs.

Default

Private subnet if assignPublicIp, public subnets otherwise

Stability

deprecated

Return type

Optional[SubnetSelection]

task_definition

Task Definition used for running tasks in the service.

Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions

Return type

TaskDefinition