Class CfnJobDefinition
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::Batch::JobDefinition.
The AWS::Batch::JobDefinition resource specifies the parameters for an AWS Batch job definition. For more information, see Job Definitions in the ** .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.batch.*;
Object labels;
Object limits;
Object options;
Object parameters;
Object requests;
Object tags;
CfnJobDefinition cfnJobDefinition = CfnJobDefinition.Builder.create(this, "MyCfnJobDefinition")
.type("type")
// the properties below are optional
.containerProperties(ContainerPropertiesProperty.builder()
.image("image")
// the properties below are optional
.command(List.of("command"))
.environment(List.of(EnvironmentProperty.builder()
.name("name")
.value("value")
.build()))
.ephemeralStorage(EphemeralStorageProperty.builder()
.sizeInGiB(123)
.build())
.executionRoleArn("executionRoleArn")
.fargatePlatformConfiguration(FargatePlatformConfigurationProperty.builder()
.platformVersion("platformVersion")
.build())
.instanceType("instanceType")
.jobRoleArn("jobRoleArn")
.linuxParameters(LinuxParametersProperty.builder()
.devices(List.of(DeviceProperty.builder()
.containerPath("containerPath")
.hostPath("hostPath")
.permissions(List.of("permissions"))
.build()))
.initProcessEnabled(false)
.maxSwap(123)
.sharedMemorySize(123)
.swappiness(123)
.tmpfs(List.of(TmpfsProperty.builder()
.containerPath("containerPath")
.size(123)
// the properties below are optional
.mountOptions(List.of("mountOptions"))
.build()))
.build())
.logConfiguration(LogConfigurationProperty.builder()
.logDriver("logDriver")
// the properties below are optional
.options(options)
.secretOptions(List.of(SecretProperty.builder()
.name("name")
.valueFrom("valueFrom")
.build()))
.build())
.memory(123)
.mountPoints(List.of(MountPointsProperty.builder()
.containerPath("containerPath")
.readOnly(false)
.sourceVolume("sourceVolume")
.build()))
.networkConfiguration(NetworkConfigurationProperty.builder()
.assignPublicIp("assignPublicIp")
.build())
.privileged(false)
.readonlyRootFilesystem(false)
.resourceRequirements(List.of(ResourceRequirementProperty.builder()
.type("type")
.value("value")
.build()))
.secrets(List.of(SecretProperty.builder()
.name("name")
.valueFrom("valueFrom")
.build()))
.ulimits(List.of(UlimitProperty.builder()
.hardLimit(123)
.name("name")
.softLimit(123)
.build()))
.user("user")
.vcpus(123)
.volumes(List.of(VolumesProperty.builder()
.efsVolumeConfiguration(EfsVolumeConfigurationProperty.builder()
.fileSystemId("fileSystemId")
// the properties below are optional
.authorizationConfig(AuthorizationConfigProperty.builder()
.accessPointId("accessPointId")
.iam("iam")
.build())
.rootDirectory("rootDirectory")
.transitEncryption("transitEncryption")
.transitEncryptionPort(123)
.build())
.host(VolumesHostProperty.builder()
.sourcePath("sourcePath")
.build())
.name("name")
.build()))
.build())
.eksProperties(EksPropertiesProperty.builder()
.podProperties(PodPropertiesProperty.builder()
.containers(List.of(EksContainerProperty.builder()
.image("image")
// the properties below are optional
.args(List.of("args"))
.command(List.of("command"))
.env(List.of(EksContainerEnvironmentVariableProperty.builder()
.name("name")
// the properties below are optional
.value("value")
.build()))
.imagePullPolicy("imagePullPolicy")
.name("name")
.resources(ResourcesProperty.builder()
.limits(limits)
.requests(requests)
.build())
.securityContext(SecurityContextProperty.builder()
.privileged(false)
.readOnlyRootFilesystem(false)
.runAsGroup(123)
.runAsNonRoot(false)
.runAsUser(123)
.build())
.volumeMounts(List.of(EksContainerVolumeMountProperty.builder()
.mountPath("mountPath")
.name("name")
.readOnly(false)
.build()))
.build()))
.dnsPolicy("dnsPolicy")
.hostNetwork(false)
.metadata(MetadataProperty.builder()
.labels(labels)
.build())
.serviceAccountName("serviceAccountName")
.volumes(List.of(EksVolumeProperty.builder()
.name("name")
// the properties below are optional
.emptyDir(EmptyDirProperty.builder()
.medium("medium")
.sizeLimit("sizeLimit")
.build())
.hostPath(HostPathProperty.builder()
.path("path")
.build())
.secret(EksSecretProperty.builder()
.secretName("secretName")
// the properties below are optional
.optional(false)
.build())
.build()))
.build())
.build())
.jobDefinitionName("jobDefinitionName")
.nodeProperties(NodePropertiesProperty.builder()
.mainNode(123)
.nodeRangeProperties(List.of(NodeRangePropertyProperty.builder()
.targetNodes("targetNodes")
// the properties below are optional
.container(ContainerPropertiesProperty.builder()
.image("image")
// the properties below are optional
.command(List.of("command"))
.environment(List.of(EnvironmentProperty.builder()
.name("name")
.value("value")
.build()))
.ephemeralStorage(EphemeralStorageProperty.builder()
.sizeInGiB(123)
.build())
.executionRoleArn("executionRoleArn")
.fargatePlatformConfiguration(FargatePlatformConfigurationProperty.builder()
.platformVersion("platformVersion")
.build())
.instanceType("instanceType")
.jobRoleArn("jobRoleArn")
.linuxParameters(LinuxParametersProperty.builder()
.devices(List.of(DeviceProperty.builder()
.containerPath("containerPath")
.hostPath("hostPath")
.permissions(List.of("permissions"))
.build()))
.initProcessEnabled(false)
.maxSwap(123)
.sharedMemorySize(123)
.swappiness(123)
.tmpfs(List.of(TmpfsProperty.builder()
.containerPath("containerPath")
.size(123)
// the properties below are optional
.mountOptions(List.of("mountOptions"))
.build()))
.build())
.logConfiguration(LogConfigurationProperty.builder()
.logDriver("logDriver")
// the properties below are optional
.options(options)
.secretOptions(List.of(SecretProperty.builder()
.name("name")
.valueFrom("valueFrom")
.build()))
.build())
.memory(123)
.mountPoints(List.of(MountPointsProperty.builder()
.containerPath("containerPath")
.readOnly(false)
.sourceVolume("sourceVolume")
.build()))
.networkConfiguration(NetworkConfigurationProperty.builder()
.assignPublicIp("assignPublicIp")
.build())
.privileged(false)
.readonlyRootFilesystem(false)
.resourceRequirements(List.of(ResourceRequirementProperty.builder()
.type("type")
.value("value")
.build()))
.secrets(List.of(SecretProperty.builder()
.name("name")
.valueFrom("valueFrom")
.build()))
.ulimits(List.of(UlimitProperty.builder()
.hardLimit(123)
.name("name")
.softLimit(123)
.build()))
.user("user")
.vcpus(123)
.volumes(List.of(VolumesProperty.builder()
.efsVolumeConfiguration(EfsVolumeConfigurationProperty.builder()
.fileSystemId("fileSystemId")
// the properties below are optional
.authorizationConfig(AuthorizationConfigProperty.builder()
.accessPointId("accessPointId")
.iam("iam")
.build())
.rootDirectory("rootDirectory")
.transitEncryption("transitEncryption")
.transitEncryptionPort(123)
.build())
.host(VolumesHostProperty.builder()
.sourcePath("sourcePath")
.build())
.name("name")
.build()))
.build())
.build()))
.numNodes(123)
.build())
.parameters(parameters)
.platformCapabilities(List.of("platformCapabilities"))
.propagateTags(false)
.retryStrategy(RetryStrategyProperty.builder()
.attempts(123)
.evaluateOnExit(List.of(EvaluateOnExitProperty.builder()
.action("action")
// the properties below are optional
.onExitCode("onExitCode")
.onReason("onReason")
.onStatusReason("onStatusReason")
.build()))
.build())
.schedulingPriority(123)
.tags(tags)
.timeout(TimeoutProperty.builder()
.attemptDurationSeconds(123)
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe authorization configuration details for the Amazon EFS file system.static final classA fluent builder forCfnJobDefinition.static interfaceContainer properties are used for Amazon ECS based job definitions.static interfaceAn object that represents a container instance host device.static interfaceThis is used when you're using an Amazon Elastic File System file system for job storage.static interfaceAn environment variable.static interfaceEKS container properties are used in job definitions for Amazon EKS based job definitions to describe the properties for a container node in the pod that's launched as part of a job.static interfaceThe volume mounts for a container for an Amazon EKS job.static interfaceAn object that contains the properties for the Kubernetes resources of a job.static interfaceExample:static interfaceSpecifies an Amazon EKS volume for a job definition.static interfaceExample:static interfaceThe Environment property type specifies environment variables to use in a job definition.static interfaceExample:static interfaceSpecifies an array of up to 5 conditions to be met, and an action to take (RETRYorEXIT) if all conditions are met.static interfaceThe platform configuration for jobs that are running on Fargate resources.static interfaceExample:static interfaceLinux-specific modifications that are applied to the container, such as details for device mappings.static interfaceLog configuration options to send to a custom log driver for the container.static interfaceExample:static interfaceDetails for a Docker volume mount point that's used in a job's container properties.static interfaceThe network configuration for jobs that are running on Fargate resources.static interfaceAn object that represents the node properties of a multi-node parallel job.static interfaceAn object that represents the properties of the node range for a multi-node parallel job.static interfaceThe properties for the pod.static interfaceThe type and amount of a resource to assign to a container.static interfaceExample:static interfaceThe retry strategy that's associated with a job.static interfaceAn object that represents the secret to expose to your container.static interfaceExample:static interfaceAn object that represents a job timeout configuration.static interfaceThe container path, mount options, and size of thetmpfsmount.static interfaceTheulimitsettings to pass to the container.static interfaceDetermine whether your data volume persists on the host container instance and where it's stored.static interfaceA list of volumes that are associated with the job.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnJobDefinition(Construct scope, String id, CfnJobDefinitionProps props) Create a newAWS::Batch::JobDefinition.protectedCfnJobDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnJobDefinition(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionAn object with various properties specific to Amazon ECS based jobs.An object with various properties that are specific to Amazon EKS based jobs.The name of the job definition.An object with various properties that are specific to multi-node parallel jobs.Default parameters or parameter substitution placeholders that are set in the job definition.The platform capabilities required by the job definition.Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.The retry strategy to use for failed jobs that are submitted with this job definition.The scheduling priority of the job definition.getTags()The tags that are applied to the job definition.The timeout time for jobs that are submitted with this job definition.getType()The type of job definition.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidAn object with various properties specific to Amazon ECS based jobs.voidAn object with various properties specific to Amazon ECS based jobs.voidsetEksProperties(IResolvable value) An object with various properties that are specific to Amazon EKS based jobs.voidAn object with various properties that are specific to Amazon EKS based jobs.voidsetJobDefinitionName(String value) The name of the job definition.voidsetNodeProperties(IResolvable value) An object with various properties that are specific to multi-node parallel jobs.voidAn object with various properties that are specific to multi-node parallel jobs.voidsetParameters(Object value) Default parameters or parameter substitution placeholders that are set in the job definition.voidsetPlatformCapabilities(List<String> value) The platform capabilities required by the job definition.voidsetPropagateTags(Boolean value) Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.voidsetPropagateTags(IResolvable value) Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.voidsetRetryStrategy(IResolvable value) The retry strategy to use for failed jobs that are submitted with this job definition.voidThe retry strategy to use for failed jobs that are submitted with this job definition.voidsetSchedulingPriority(Number value) The scheduling priority of the job definition.voidsetTimeout(IResolvable value) The timeout time for jobs that are submitted with this job definition.voidThe timeout time for jobs that are submitted with this job definition.voidThe type of job definition.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnJobDefinition
protected CfnJobDefinition(software.amazon.jsii.JsiiObjectRef objRef) -
CfnJobDefinition
protected CfnJobDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnJobDefinition
@Stability(Stable) public CfnJobDefinition(@NotNull Construct scope, @NotNull String id, @NotNull CfnJobDefinitionProps props) Create a newAWS::Batch::JobDefinition.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
The tags that are applied to the job definition. -
getParameters
Default parameters or parameter substitution placeholders that are set in the job definition.Parameters are specified as a key-value pair mapping. Parameters in a
SubmitJobrequest override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see Job definition parameters in the AWS Batch User Guide . -
setParameters
Default parameters or parameter substitution placeholders that are set in the job definition.Parameters are specified as a key-value pair mapping. Parameters in a
SubmitJobrequest override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see Job definition parameters in the AWS Batch User Guide . -
getType
The type of job definition.For more information about multi-node parallel jobs, see Creating a multi-node parallel job definition in the AWS Batch User Guide .
If the job is run on Fargate resources, then
multinodeisn't supported. -
setType
The type of job definition.For more information about multi-node parallel jobs, see Creating a multi-node parallel job definition in the AWS Batch User Guide .
If the job is run on Fargate resources, then
multinodeisn't supported. -
getContainerProperties
An object with various properties specific to Amazon ECS based jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified. -
setContainerProperties
An object with various properties specific to Amazon ECS based jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified. -
setContainerProperties
@Stability(Stable) public void setContainerProperties(@Nullable CfnJobDefinition.ContainerPropertiesProperty value) An object with various properties specific to Amazon ECS based jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified. -
getEksProperties
An object with various properties that are specific to Amazon EKS based jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified. -
setEksProperties
An object with various properties that are specific to Amazon EKS based jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified. -
setEksProperties
@Stability(Stable) public void setEksProperties(@Nullable CfnJobDefinition.EksPropertiesProperty value) An object with various properties that are specific to Amazon EKS based jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified. -
getJobDefinitionName
The name of the job definition. -
setJobDefinitionName
The name of the job definition. -
getNodeProperties
An object with various properties that are specific to multi-node parallel jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified.If the job runs on Fargate resources, don't specify
nodeProperties. UsecontainerPropertiesinstead. -
setNodeProperties
An object with various properties that are specific to multi-node parallel jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified.If the job runs on Fargate resources, don't specify
nodeProperties. UsecontainerPropertiesinstead. -
setNodeProperties
@Stability(Stable) public void setNodeProperties(@Nullable CfnJobDefinition.NodePropertiesProperty value) An object with various properties that are specific to multi-node parallel jobs.Valid values are
containerProperties,eksProperties, andnodeProperties. Only one can be specified.If the job runs on Fargate resources, don't specify
nodeProperties. UsecontainerPropertiesinstead. -
getPlatformCapabilities
The platform capabilities required by the job definition.If no value is specified, it defaults to
EC2. Jobs run on Fargate resources specifyFARGATE. -
setPlatformCapabilities
The platform capabilities required by the job definition.If no value is specified, it defaults to
EC2. Jobs run on Fargate resources specifyFARGATE. -
getPropagateTags
Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the
FAILEDstate. -
setPropagateTags
Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the
FAILEDstate. -
setPropagateTags
Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the
FAILEDstate. -
getRetryStrategy
The retry strategy to use for failed jobs that are submitted with this job definition. -
setRetryStrategy
The retry strategy to use for failed jobs that are submitted with this job definition. -
setRetryStrategy
@Stability(Stable) public void setRetryStrategy(@Nullable CfnJobDefinition.RetryStrategyProperty value) The retry strategy to use for failed jobs that are submitted with this job definition. -
getSchedulingPriority
The scheduling priority of the job definition.This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
-
setSchedulingPriority
The scheduling priority of the job definition.This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
-
getTimeout
The timeout time for jobs that are submitted with this job definition.After the amount of time you specify passes, AWS Batch terminates your jobs if they aren't finished.
-
setTimeout
The timeout time for jobs that are submitted with this job definition.After the amount of time you specify passes, AWS Batch terminates your jobs if they aren't finished.
-
setTimeout
The timeout time for jobs that are submitted with this job definition.After the amount of time you specify passes, AWS Batch terminates your jobs if they aren't finished.
-