# PipeTargetEcsTaskParametersProperty

The parameters for using an Amazon ECS task as a target.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_pipes as pipes } from 'aws-cdk-lib';
const pipeTargetEcsTaskParametersProperty: pipes.CfnPipe.PipeTargetEcsTaskParametersProperty = {
  taskDefinitionArn: 'taskDefinitionArn',

  // the properties below are optional
  capacityProviderStrategy: [{
    capacityProvider: 'capacityProvider',

    // the properties below are optional
    base: 123,
    weight: 123,
  }],
  enableEcsManagedTags: false,
  enableExecuteCommand: false,
  group: 'group',
  launchType: 'launchType',
  networkConfiguration: {
    awsvpcConfiguration: {
      subnets: ['subnets'],

      // the properties below are optional
      assignPublicIp: 'assignPublicIp',
      securityGroups: ['securityGroups'],
    },
  },
  overrides: {
    containerOverrides: [{
      command: ['command'],
      cpu: 123,
      environment: [{
        name: 'name',
        value: 'value',
      }],
      environmentFiles: [{
        type: 'type',
        value: 'value',
      }],
      memory: 123,
      memoryReservation: 123,
      name: 'name',
      resourceRequirements: [{
        type: 'type',
        value: 'value',
      }],
    }],
    cpu: 'cpu',
    ephemeralStorage: {
      sizeInGiB: 123,
    },
    executionRoleArn: 'executionRoleArn',
    inferenceAcceleratorOverrides: [{
      deviceName: 'deviceName',
      deviceType: 'deviceType',
    }],
    memory: 'memory',
    taskRoleArn: 'taskRoleArn',
  },
  placementConstraints: [{
    expression: 'expression',
    type: 'type',
  }],
  placementStrategy: [{
    field: 'field',
    type: 'type',
  }],
  platformVersion: 'platformVersion',
  propagateTags: 'propagateTags',
  referenceId: 'referenceId',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  taskCount: 123,
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_pipes as pipes

pipe_target_ecs_task_parameters_property = pipes.CfnPipe.PipeTargetEcsTaskParametersProperty(
    task_definition_arn="taskDefinitionArn",

    # the properties below are optional
    capacity_provider_strategy=[pipes.CfnPipe.CapacityProviderStrategyItemProperty(
        capacity_provider="capacityProvider",

        # the properties below are optional
        base=123,
        weight=123
    )],
    enable_ecs_managed_tags=False,
    enable_execute_command=False,
    group="group",
    launch_type="launchType",
    network_configuration=pipes.CfnPipe.NetworkConfigurationProperty(
        awsvpc_configuration=pipes.CfnPipe.AwsVpcConfigurationProperty(
            subnets=["subnets"],

            # the properties below are optional
            assign_public_ip="assignPublicIp",
            security_groups=["securityGroups"]
        )
    ),
    overrides=pipes.CfnPipe.EcsTaskOverrideProperty(
        container_overrides=[pipes.CfnPipe.EcsContainerOverrideProperty(
            command=["command"],
            cpu=123,
            environment=[pipes.CfnPipe.EcsEnvironmentVariableProperty(
                name="name",
                value="value"
            )],
            environment_files=[pipes.CfnPipe.EcsEnvironmentFileProperty(
                type="type",
                value="value"
            )],
            memory=123,
            memory_reservation=123,
            name="name",
            resource_requirements=[pipes.CfnPipe.EcsResourceRequirementProperty(
                type="type",
                value="value"
            )]
        )],
        cpu="cpu",
        ephemeral_storage=pipes.CfnPipe.EcsEphemeralStorageProperty(
            size_in_gi_b=123
        ),
        execution_role_arn="executionRoleArn",
        inference_accelerator_overrides=[pipes.CfnPipe.EcsInferenceAcceleratorOverrideProperty(
            device_name="deviceName",
            device_type="deviceType"
        )],
        memory="memory",
        task_role_arn="taskRoleArn"
    ),
    placement_constraints=[pipes.CfnPipe.PlacementConstraintProperty(
        expression="expression",
        type="type"
    )],
    placement_strategy=[pipes.CfnPipe.PlacementStrategyProperty(
        field="field",
        type="type"
    )],
    platform_version="platformVersion",
    propagate_tags="propagateTags",
    reference_id="referenceId",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    task_count=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.pipes.*;

PipeTargetEcsTaskParametersProperty pipeTargetEcsTaskParametersProperty = PipeTargetEcsTaskParametersProperty.builder()
        .taskDefinitionArn("taskDefinitionArn")

        // the properties below are optional
        .capacityProviderStrategy(List.of(CapacityProviderStrategyItemProperty.builder()
                .capacityProvider("capacityProvider")

                // the properties below are optional
                .base(123)
                .weight(123)
                .build()))
        .enableEcsManagedTags(false)
        .enableExecuteCommand(false)
        .group("group")
        .launchType("launchType")
        .networkConfiguration(NetworkConfigurationProperty.builder()
                .awsvpcConfiguration(AwsVpcConfigurationProperty.builder()
                        .subnets(List.of("subnets"))

                        // the properties below are optional
                        .assignPublicIp("assignPublicIp")
                        .securityGroups(List.of("securityGroups"))
                        .build())
                .build())
        .overrides(EcsTaskOverrideProperty.builder()
                .containerOverrides(List.of(EcsContainerOverrideProperty.builder()
                        .command(List.of("command"))
                        .cpu(123)
                        .environment(List.of(EcsEnvironmentVariableProperty.builder()
                                .name("name")
                                .value("value")
                                .build()))
                        .environmentFiles(List.of(EcsEnvironmentFileProperty.builder()
                                .type("type")
                                .value("value")
                                .build()))
                        .memory(123)
                        .memoryReservation(123)
                        .name("name")
                        .resourceRequirements(List.of(EcsResourceRequirementProperty.builder()
                                .type("type")
                                .value("value")
                                .build()))
                        .build()))
                .cpu("cpu")
                .ephemeralStorage(EcsEphemeralStorageProperty.builder()
                        .sizeInGiB(123)
                        .build())
                .executionRoleArn("executionRoleArn")
                .inferenceAcceleratorOverrides(List.of(EcsInferenceAcceleratorOverrideProperty.builder()
                        .deviceName("deviceName")
                        .deviceType("deviceType")
                        .build()))
                .memory("memory")
                .taskRoleArn("taskRoleArn")
                .build())
        .placementConstraints(List.of(PlacementConstraintProperty.builder()
                .expression("expression")
                .type("type")
                .build()))
        .placementStrategy(List.of(PlacementStrategyProperty.builder()
                .field("field")
                .type("type")
                .build()))
        .platformVersion("platformVersion")
        .propagateTags("propagateTags")
        .referenceId("referenceId")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .taskCount(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Pipes;

var pipeTargetEcsTaskParametersProperty = new PipeTargetEcsTaskParametersProperty {
    TaskDefinitionArn = "taskDefinitionArn",

    // the properties below are optional
    CapacityProviderStrategy = new [] { new CapacityProviderStrategyItemProperty {
        CapacityProvider = "capacityProvider",

        // the properties below are optional
        Base = 123,
        Weight = 123
    } },
    EnableEcsManagedTags = false,
    EnableExecuteCommand = false,
    Group = "group",
    LaunchType = "launchType",
    NetworkConfiguration = new NetworkConfigurationProperty {
        AwsvpcConfiguration = new AwsVpcConfigurationProperty {
            Subnets = new [] { "subnets" },

            // the properties below are optional
            AssignPublicIp = "assignPublicIp",
            SecurityGroups = new [] { "securityGroups" }
        }
    },
    Overrides = new EcsTaskOverrideProperty {
        ContainerOverrides = new [] { new EcsContainerOverrideProperty {
            Command = new [] { "command" },
            Cpu = 123,
            Environment = new [] { new EcsEnvironmentVariableProperty {
                Name = "name",
                Value = "value"
            } },
            EnvironmentFiles = new [] { new EcsEnvironmentFileProperty {
                Type = "type",
                Value = "value"
            } },
            Memory = 123,
            MemoryReservation = 123,
            Name = "name",
            ResourceRequirements = new [] { new EcsResourceRequirementProperty {
                Type = "type",
                Value = "value"
            } }
        } },
        Cpu = "cpu",
        EphemeralStorage = new EcsEphemeralStorageProperty {
            SizeInGiB = 123
        },
        ExecutionRoleArn = "executionRoleArn",
        InferenceAcceleratorOverrides = new [] { new EcsInferenceAcceleratorOverrideProperty {
            DeviceName = "deviceName",
            DeviceType = "deviceType"
        } },
        Memory = "memory",
        TaskRoleArn = "taskRoleArn"
    },
    PlacementConstraints = new [] { new PlacementConstraintProperty {
        Expression = "expression",
        Type = "type"
    } },
    PlacementStrategy = new [] { new PlacementStrategyProperty {
        Field = "field",
        Type = "type"
    } },
    PlatformVersion = "platformVersion",
    PropagateTags = "propagateTags",
    ReferenceId = "referenceId",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    TaskCount = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

pipeTargetEcsTaskParametersProperty := &PipeTargetEcsTaskParametersProperty{
	TaskDefinitionArn: jsii.String("taskDefinitionArn"),

	// the properties below are optional
	CapacityProviderStrategy: []interface{}{
		&CapacityProviderStrategyItemProperty{
			CapacityProvider: jsii.String("capacityProvider"),

			// the properties below are optional
			Base: jsii.Number(123),
			Weight: jsii.Number(123),
		},
	},
	EnableEcsManagedTags: jsii.Boolean(false),
	EnableExecuteCommand: jsii.Boolean(false),
	Group: jsii.String("group"),
	LaunchType: jsii.String("launchType"),
	NetworkConfiguration: &NetworkConfigurationProperty{
		AwsvpcConfiguration: &AwsVpcConfigurationProperty{
			Subnets: []*string{
				jsii.String("subnets"),
			},

			// the properties below are optional
			AssignPublicIp: jsii.String("assignPublicIp"),
			SecurityGroups: []*string{
				jsii.String("securityGroups"),
			},
		},
	},
	Overrides: &EcsTaskOverrideProperty{
		ContainerOverrides: []interface{}{
			&EcsContainerOverrideProperty{
				Command: []*string{
					jsii.String("command"),
				},
				Cpu: jsii.Number(123),
				Environment: []interface{}{
					&EcsEnvironmentVariableProperty{
						Name: jsii.String("name"),
						Value: jsii.String("value"),
					},
				},
				EnvironmentFiles: []interface{}{
					&EcsEnvironmentFileProperty{
						Type: jsii.String("type"),
						Value: jsii.String("value"),
					},
				},
				Memory: jsii.Number(123),
				MemoryReservation: jsii.Number(123),
				Name: jsii.String("name"),
				ResourceRequirements: []interface{}{
					&EcsResourceRequirementProperty{
						Type: jsii.String("type"),
						Value: jsii.String("value"),
					},
				},
			},
		},
		Cpu: jsii.String("cpu"),
		EphemeralStorage: &EcsEphemeralStorageProperty{
			SizeInGiB: jsii.Number(123),
		},
		ExecutionRoleArn: jsii.String("executionRoleArn"),
		InferenceAcceleratorOverrides: []interface{}{
			&EcsInferenceAcceleratorOverrideProperty{
				DeviceName: jsii.String("deviceName"),
				DeviceType: jsii.String("deviceType"),
			},
		},
		Memory: jsii.String("memory"),
		TaskRoleArn: jsii.String("taskRoleArn"),
	},
	PlacementConstraints: []interface{}{
		&PlacementConstraintProperty{
			Expression: jsii.String("expression"),
			Type: jsii.String("type"),
		},
	},
	PlacementStrategy: []interface{}{
		&PlacementStrategyProperty{
			Field: jsii.String("field"),
			Type: jsii.String("type"),
		},
	},
	PlatformVersion: jsii.String("platformVersion"),
	PropagateTags: jsii.String("propagateTags"),
	ReferenceId: jsii.String("referenceId"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	TaskCount: jsii.Number(123),
}
```

## Properties

- `capacityProviderStrategy`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPipe.CapacityProviderStrategyItemProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.CapacityProviderStrategyItemProperty.html)[] — The capacity provider strategy to use for the task.

  If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or launchType is specified, the `defaultCapacityProviderStrategy` for the cluster is used.

- `enableEcsManagedTags`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = false — Specifies whether to enable Amazon ECS managed tags for the task.

  For more information, see [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the Amazon Elastic Container Service Developer Guide.

- `enableExecuteCommand`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = false — Whether or not to enable the execute command functionality for the containers in this task.

  If true, this enables execute command functionality on all containers in the task.

- `group`: string — Specifies an Amazon ECS task group for the task.

  The maximum length is 255 characters.

- `launchType`: string — Specifies the launch type on which your task is running.

  The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The `FARGATE` value is supported only in the Regions where AWS Fargate with Amazon ECS is supported. For more information, see [AWS Fargate on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html) in the *Amazon Elastic Container Service Developer Guide* .

- `networkConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPipe.NetworkConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.NetworkConfigurationProperty.html) — Use this structure if the Amazon ECS task uses the `awsvpc` network mode.

  This structure specifies the VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This structure is required if `LaunchType` is `FARGATE` because the `awsvpc` mode is required for Fargate tasks.

  If you specify `NetworkConfiguration` when the target ECS task does not use the `awsvpc` network mode, the task fails.

- `overrides`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPipe.EcsTaskOverrideProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.EcsTaskOverrideProperty.html) — The overrides that are associated with a task.

- `placementConstraints`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPipe.PlacementConstraintProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.PlacementConstraintProperty.html)[] — An array of placement constraint objects to use for the task.

  You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).

- `placementStrategy`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPipe.PlacementStrategyProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.PlacementStrategyProperty.html)[] — The placement strategy objects to use for the task.

  You can specify a maximum of five strategy rules per task.

- `platformVersion`: string — Specifies the platform version for the task.

  Specify only the numeric portion of the platform version, such as `1.1.0` .

  This structure is used only if `LaunchType` is `FARGATE` . For more information about valid platform versions, see [AWS Fargate Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide* .

- `propagateTags`: string — Specifies whether to propagate the tags from the task definition to the task.

  If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the `TagResource` API action.

- `referenceId`: string — The reference ID to use for the task.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The metadata that you apply to the task to help you categorize and organize them.

  Each tag consists of a key and an optional value, both of which you define. To learn more, see [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags) in the Amazon ECS API Reference.

- `taskCount`: number — The number of tasks to create based on `TaskDefinition` .

  The default is 1.

- `taskDefinitionArn`: string (required) — The ARN of the task definition to use if the event target is an Amazon ECS task.
