Interface EcsEc2ContainerDefinitionProps
- All Superinterfaces:
EcsContainerDefinitionProps,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
EcsEc2ContainerDefinitionProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:09:59.628Z")
@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);
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forEcsEc2ContainerDefinitionPropsstatic final classAn implementation forEcsEc2ContainerDefinitionProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default NumbergetGpu()The number of physical GPUs to reserve for the container.default BooleanWhen this parameter is true, the container is given elevated permissions on the host container instance (similar to the root user).Limits to set for the user this docker container will run as.Methods inherited from interface software.amazon.awscdk.services.batch.EcsContainerDefinitionProps
getCommand, getCpu, getEnableExecuteCommand, getEnvironment, getExecutionRole, getImage, getJobRole, getLinuxParameters, getLogging, getMemory, getReadonlyRootFilesystem, getSecrets, getUser, getVolumesMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
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
When this parameter is true, the container is given elevated permissions on the host container instance (similar to the root user).Default: false
-
getUlimits
Limits to set for the user this docker container will run as.Default: - no ulimits
-
builder
-