# PidMode

The process namespace to use for the containers in the task.

- Source: [`aws-ecs/lib/base/task-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts#L1097)

## Example

```ts
const fargateTaskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
  runtimePlatform: {
    operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
    cpuArchitecture: ecs.CpuArchitecture.ARM64,
  },
  memoryLimitMiB: 512,
  cpu: 256,
  pidMode: ecs.PidMode.TASK,
});
```

## Members

| Member | Description |
| --- | --- |
| `HOST` | If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. |
| `TASK` | If task is specified, all containers within the specified task share the same process namespace. |

## Referenced by

- [`Ec2TaskDefinitionProps`](/v2/docs/aws-cdk-lib.aws_ecs.Ec2TaskDefinitionProps).pidMode
- [`FargateTaskDefinitionProps`](/v2/docs/aws-cdk-lib.aws_ecs.FargateTaskDefinitionProps).pidMode
- [`TaskDefinition`](/v2/docs/aws-cdk-lib.aws_ecs.TaskDefinition).pidMode
- [`TaskDefinitionProps`](/v2/docs/aws-cdk-lib.aws_ecs.TaskDefinitionProps).pidMode
