Interface Ec2TaskDefinitionProps

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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-08-02T00:29:10.265Z") @Stability(Stable) public interface Ec2TaskDefinitionProps extends software.amazon.jsii.JsiiSerializable, CommonTaskDefinitionProps
The properties for a task definition run on an EC2 cluster.

Example:

 Ec2TaskDefinition ec2TaskDefinition = Ec2TaskDefinition.Builder.create(this, "TaskDef")
         .networkMode(NetworkMode.BRIDGE)
         .build();
 ContainerDefinition container = ec2TaskDefinition.addContainer("WebContainer", ContainerDefinitionOptions.builder()
         // Use an image from DockerHub
         .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
         .memoryLimitMiB(1024)
         .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