Class JobDefinitionContainer.Builder
java.lang.Object
software.amazon.awscdk.services.batch.JobDefinitionContainer.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<JobDefinitionContainer>
- Enclosing interface:
- JobDefinitionContainer
@Stability(Experimental)
public static final class JobDefinitionContainer.Builder
extends Object
implements software.amazon.jsii.Builder<JobDefinitionContainer>
A builder for
JobDefinitionContainer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassignPublicIp
(Boolean assignPublicIp) Sets the value ofJobDefinitionContainer.getAssignPublicIp()
build()
Builds the configured instance.Sets the value ofJobDefinitionContainer.getCommand()
environment
(Map<String, String> environment) Sets the value ofJobDefinitionContainer.getEnvironment()
executionRole
(IRole executionRole) Sets the value ofJobDefinitionContainer.getExecutionRole()
Sets the value ofJobDefinitionContainer.getGpuCount()
image
(ContainerImage image) Sets the value ofJobDefinitionContainer.getImage()
instanceType
(InstanceType instanceType) Sets the value ofJobDefinitionContainer.getInstanceType()
Sets the value ofJobDefinitionContainer.getJobRole()
linuxParams
(LinuxParameters linuxParams) Sets the value ofJobDefinitionContainer.getLinuxParams()
logConfiguration
(LogConfiguration logConfiguration) Sets the value ofJobDefinitionContainer.getLogConfiguration()
memoryLimitMiB
(Number memoryLimitMiB) Sets the value ofJobDefinitionContainer.getMemoryLimitMiB()
mountPoints
(List<? extends MountPoint> mountPoints) Sets the value ofJobDefinitionContainer.getMountPoints()
platformVersion
(FargatePlatformVersion platformVersion) Sets the value ofJobDefinitionContainer.getPlatformVersion()
privileged
(Boolean privileged) Sets the value ofJobDefinitionContainer.getPrivileged()
Sets the value ofJobDefinitionContainer.getReadOnly()
Sets the value ofJobDefinitionContainer.getUlimits()
Sets the value ofJobDefinitionContainer.getUser()
Sets the value ofJobDefinitionContainer.getVcpus()
Sets the value ofJobDefinitionContainer.getVolumes()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
image
Sets the value ofJobDefinitionContainer.getImage()
- Parameters:
image
- The image used to start a container. This parameter is required.- Returns:
this
-
assignPublicIp
@Stability(Experimental) public JobDefinitionContainer.Builder assignPublicIp(Boolean assignPublicIp) Sets the value ofJobDefinitionContainer.getAssignPublicIp()
- Parameters:
assignPublicIp
- Whether or not to assign a public IP to the job.- Returns:
this
-
command
Sets the value ofJobDefinitionContainer.getCommand()
- Parameters:
command
- The command that is passed to the container. If you provide a shell command as a single string, you have to quote command-line arguments.- Returns:
this
-
environment
@Stability(Experimental) public JobDefinitionContainer.Builder environment(Map<String, String> environment) Sets the value ofJobDefinitionContainer.getEnvironment()
- Parameters:
environment
- The environment variables to pass to the container.- Returns:
this
-
executionRole
Sets the value ofJobDefinitionContainer.getExecutionRole()
- Parameters:
executionRole
- The IAM role that AWS Batch can assume. Required when using Fargate.- Returns:
this
-
gpuCount
Sets the value ofJobDefinitionContainer.getGpuCount()
- Parameters:
gpuCount
- The number of physical GPUs to reserve for the container. The number of GPUs reserved for all containers in a job should not exceed the number of available GPUs on the compute resource that the job is launched on.- Returns:
this
-
instanceType
@Stability(Experimental) public JobDefinitionContainer.Builder instanceType(InstanceType instanceType) Sets the value ofJobDefinitionContainer.getInstanceType()
- Parameters:
instanceType
- The instance type to use for a multi-node parallel job. Currently all node groups in a multi-node parallel job must use the same instance type. This parameter is not valid for single-node container jobs.- Returns:
this
-
jobRole
Sets the value ofJobDefinitionContainer.getJobRole()
- Parameters:
jobRole
- The IAM role that the container can assume for AWS permissions.- Returns:
this
-
linuxParams
@Stability(Experimental) public JobDefinitionContainer.Builder linuxParams(LinuxParameters linuxParams) Sets the value ofJobDefinitionContainer.getLinuxParams()
- Parameters:
linuxParams
- Linux-specific modifications that are applied to the container, such as details for device mappings. For now, only thedevices
property is supported.- Returns:
this
-
logConfiguration
@Stability(Experimental) public JobDefinitionContainer.Builder logConfiguration(LogConfiguration logConfiguration) Sets the value ofJobDefinitionContainer.getLogConfiguration()
- Parameters:
logConfiguration
- The log configuration specification for the container.- Returns:
this
-
memoryLimitMiB
@Stability(Experimental) public JobDefinitionContainer.Builder memoryLimitMiB(Number memoryLimitMiB) Sets the value ofJobDefinitionContainer.getMemoryLimitMiB()
- Parameters:
memoryLimitMiB
- The hard limit (in MiB) of memory to present to the container. If your container attempts to exceed the memory specified here, the container is killed. You must specify at least 4 MiB of memory for EC2 and 512 MiB for Fargate.- Returns:
this
-
mountPoints
@Stability(Experimental) public JobDefinitionContainer.Builder mountPoints(List<? extends MountPoint> mountPoints) Sets the value ofJobDefinitionContainer.getMountPoints()
- Parameters:
mountPoints
- The mount points for data volumes in your container.- Returns:
this
-
platformVersion
@Stability(Experimental) public JobDefinitionContainer.Builder platformVersion(FargatePlatformVersion platformVersion) Sets the value ofJobDefinitionContainer.getPlatformVersion()
- Parameters:
platformVersion
- Fargate platform version.- Returns:
this
-
privileged
Sets the value ofJobDefinitionContainer.getPrivileged()
- Parameters:
privileged
- When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).- Returns:
this
-
readOnly
Sets the value ofJobDefinitionContainer.getReadOnly()
- Parameters:
readOnly
- When this parameter is true, the container is given read-only access to its root file system.- Returns:
this
-
ulimits
@Stability(Experimental) public JobDefinitionContainer.Builder ulimits(List<? extends Ulimit> ulimits) Sets the value ofJobDefinitionContainer.getUlimits()
- Parameters:
ulimits
- A list of ulimits to set in the container.- Returns:
this
-
user
Sets the value ofJobDefinitionContainer.getUser()
- Parameters:
user
- The user name to use inside the container.- Returns:
this
-
vcpus
Sets the value ofJobDefinitionContainer.getVcpus()
- Parameters:
vcpus
- The number of vCPUs reserved for the container. Each vCPU is equivalent to 1,024 CPU shares. You must specify at least one vCPU for EC2 and 0.25 for Fargate.- Returns:
this
-
volumes
@Stability(Experimental) public JobDefinitionContainer.Builder volumes(List<? extends Volume> volumes) Sets the value ofJobDefinitionContainer.getVolumes()
- Parameters:
volumes
- A list of data volumes used in a job.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<JobDefinitionContainer>
- Returns:
- a new instance of
JobDefinitionContainer
- Throws:
NullPointerException
- if any required attribute was not provided
-