Interface EcsEc2ContainerDefinitionProps

All Superinterfaces:
EcsContainerDefinitionProps, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
EcsEc2ContainerDefinitionProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-09-11T18:01:11.995Z") @Stability(Stable) public interface EcsEc2ContainerDefinitionProps extends software.amazon.jsii.JsiiSerializable, EcsContainerDefinitionProps
Props to configure an EcsEc2ContainerDefinition.

Example:

 IVpc vpc;
 EcsJobDefinition ecsJob = EcsJobDefinition.Builder.create(this, "JobDefn")
         .container(EcsEc2ContainerDefinition.Builder.create(this, "containerDefn")
                 .image(ContainerImage.fromRegistry("public.ecr.aws/amazonlinux/amazonlinux:latest"))
                 .memory(Size.mebibytes(2048))
                 .cpu(256)
                 .build())
         .build();
 JobQueue queue = JobQueue.Builder.create(this, "JobQueue")
         .computeEnvironments(List.of(OrderedComputeEnvironment.builder()
                 .computeEnvironment(ManagedEc2EcsComputeEnvironment.Builder.create(this, "managedEc2CE")
                         .vpc(vpc)
                         .build())
                 .order(1)
                 .build()))
         .priority(10)
         .build();
 User user = new User(this, "MyUser");
 ecsJob.grantSubmitJob(user, queue);
 
  • Method Details

    • getGpu

      @Stability(Stable) @Nullable default Number getGpu()
      The number of physical GPUs to reserve for the container.

      Make sure that the number of GPUs reserved for all containers in a job doesn't exceed the number of available GPUs on the compute resource that the job is launched on.

      Default: - no gpus

    • getPrivileged

      @Stability(Stable) @Nullable default Boolean getPrivileged()
      When this parameter is true, the container is given elevated permissions on the host container instance (similar to the root user).

      Default: false

    • getUlimits

      @Stability(Stable) @Nullable default List<Ulimit> getUlimits()
      Limits to set for the user this docker container will run as.

      Default: - no ulimits

    • builder

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