Interface EcsEc2ContainerDefinitionProps

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

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-04-02T21:55:05.473Z") @Stability(Stable) public interface EcsEc2ContainerDefinitionProps extends software.amazon.jsii.JsiiSerializable, EcsContainerDefinitionProps
Props to configure an EcsEc2ContainerDefinition.

Example:

 IFileSystem myFileSystem;
 Role myJobRole;
 myFileSystem.grantRead(myJobRole);
 EcsJobDefinition jobDefn = 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)
                 .volumes(List.of(EcsVolume.efs(EfsVolumeOptions.builder()
                         .name("myVolume")
                         .fileSystem(myFileSystem)
                         .containerPath("/Volumes/myVolume")
                         .useJobRole(true)
                         .build())))
                 .jobRole(myJobRole)
                 .build())
         .build();
 
  • 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