Skip to content
v2.277.0

PidMode Enum ​

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

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,
});
python
fargate_task_definition = ecs.FargateTaskDefinition(self, "TaskDef",
    runtime_platform=ecs.RuntimePlatform(
        operating_system_family=ecs.OperatingSystemFamily.LINUX,
        cpu_architecture=ecs.CpuArchitecture.ARM64
    ),
    memory_limit_mi_b=512,
    cpu=256,
    pid_mode=ecs.PidMode.TASK
)
java
FargateTaskDefinition fargateTaskDefinition = FargateTaskDefinition.Builder.create(this, "TaskDef")
        .runtimePlatform(RuntimePlatform.builder()
                .operatingSystemFamily(OperatingSystemFamily.LINUX)
                .cpuArchitecture(CpuArchitecture.ARM64)
                .build())
        .memoryLimitMiB(512)
        .cpu(256)
        .pidMode(PidMode.TASK)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var fargateTaskDefinition = new FargateTaskDefinition(this, "TaskDef", new FargateTaskDefinitionProps {
    RuntimePlatform = new RuntimePlatform {
        OperatingSystemFamily = OperatingSystemFamily.LINUX,
        CpuArchitecture = CpuArchitecture.ARM64
    },
    MemoryLimitMiB = 512,
    Cpu = 256,
    PidMode = PidMode.TASK
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
fargateTaskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef"), &FargateTaskDefinitionProps{
	RuntimePlatform: &RuntimePlatform{
		OperatingSystemFamily: ecs.OperatingSystemFamily_LINUX(),
		CpuArchitecture: ecs.CpuArchitecture_ARM64(),
	},
	MemoryLimitMiB: jsii.Number(512),
	Cpu: jsii.Number(256),
	PidMode: ecs.PidMode_TASK,
})

Members ​

MemberDescription
HOSTIf 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.
TASKIf task is specified, all containers within the specified task share the same process namespace.

Referenced by ​