# EcsTaskOverrideProperty

Struct · External

The overrides that are associated with a task.

- 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 ecsTaskOverrideProperty: pipes.CfnPipe.EcsTaskOverrideProperty = {
  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',
};
```

Python:

```python
# 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

ecs_task_override_property = 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"
)
```

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.*;

EcsTaskOverrideProperty ecsTaskOverrideProperty = 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();
```

C#:

```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 ecsTaskOverrideProperty = 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"
};
```

Go:

```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"

ecsTaskOverrideProperty := &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"),
}
```

## Properties

- `containerOverrides`: [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.EcsContainerOverrideProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.EcsContainerOverrideProperty.html)[] — One or more container overrides that are sent to a task.

- `cpu`: string — The cpu override for the task.

- `ephemeralStorage`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPipe.EcsEphemeralStorageProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.EcsEphemeralStorageProperty.html) — The ephemeral storage setting override for the task.

  > This parameter is only supported for tasks hosted on Fargate that use the following platform versions:
  >
  > - Linux platform version `1.4.0` or later.
  > - Windows platform version `1.0.0` or later.

- `executionRoleArn`: string — The Amazon Resource Name (ARN) of the task execution IAM role override for the task.

  For more information, see [Amazon ECS task execution IAM role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) in the *Amazon Elastic Container Service Developer Guide* .

- `inferenceAcceleratorOverrides`: [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.EcsInferenceAcceleratorOverrideProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.EcsInferenceAcceleratorOverrideProperty.html)[] — The Elastic Inference accelerator override for the task.

- `memory`: string — The memory override for the task.

- `taskRoleArn`: string — The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume.

  All containers in this task are granted the permissions that are specified in this role. For more information, see [IAM Role for Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic Container Service Developer Guide* .
