Interface Ec2TaskDefinitionProps

All Superinterfaces:
CommonTaskDefinitionProps, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
Ec2TaskDefinitionProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.110.0 (build 336b265)", date="2025-04-22T23:08:11.664Z") @Stability(Stable) public interface Ec2TaskDefinitionProps extends software.amazon.jsii.JsiiSerializable, CommonTaskDefinitionProps
The properties for a task definition run on an EC2 cluster.

Example:

 Map<String, String>[] inferenceAccelerators = List.of(Map.of(
         "deviceName", "device1",
         "deviceType", "eia2.medium"));
 Ec2TaskDefinition taskDefinition = Ec2TaskDefinition.Builder.create(this, "Ec2TaskDef")
         .inferenceAccelerators(inferenceAccelerators)
         .build();
 
  • Method Details

    • getInferenceAccelerators

      @Stability(Stable) @Nullable default List<InferenceAccelerator> getInferenceAccelerators()
      The inference accelerators to use for the containers in the task.

      Not supported in Fargate.

      Default: - No inference accelerators.

    • getIpcMode

      @Stability(Stable) @Nullable default IpcMode getIpcMode()
      The IPC resource namespace to use for the containers in the task.

      Not supported in Fargate and Windows containers.

      Default: - IpcMode used by the task is not specified

    • getNetworkMode

      @Stability(Stable) @Nullable default NetworkMode getNetworkMode()
      The Docker networking mode to use for the containers in the task.

      The valid values are NONE, BRIDGE, AWS_VPC, and HOST.

      Default: - NetworkMode.BRIDGE for EC2 tasks, AWS_VPC for Fargate tasks.

    • getPidMode

      @Stability(Stable) @Nullable default PidMode getPidMode()
      The process namespace to use for the containers in the task.

      Not supported in Windows containers.

      Default: - PidMode used by the task is not specified

    • getPlacementConstraints

      @Stability(Stable) @Nullable default List<PlacementConstraint> getPlacementConstraints()
      An array of placement constraint objects to use for the task.

      You can specify a maximum of 10 constraints per task (this limit includes constraints in the task definition and those specified at run time).

      Default: - No placement constraints.

    • builder

      @Stability(Stable) static Ec2TaskDefinitionProps.Builder builder()
      Returns:
      a Ec2TaskDefinitionProps.Builder of Ec2TaskDefinitionProps