@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.889Z") @Stability(value=Stable) public class CfnJobDefinition extends CfnResource implements IInspectable
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 options;
Object parameters;
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()))
.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())
.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()))
.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();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnJobDefinition.AuthorizationConfigProperty
The authorization configuration details for the Amazon EFS file system.
|
static class |
CfnJobDefinition.Builder
A fluent builder for
CfnJobDefinition. |
static interface |
CfnJobDefinition.ContainerPropertiesProperty
Container properties are used in job definitions to describe the container that's launched as part of a job.
|
static interface |
CfnJobDefinition.DeviceProperty
An object representing a container instance host device.
|
static interface |
CfnJobDefinition.EfsVolumeConfigurationProperty
This is used when you're using an Amazon Elastic File System file system for job storage.
|
static interface |
CfnJobDefinition.EnvironmentProperty
The Environment property type specifies environment variables to use in a job definition.
|
static interface |
CfnJobDefinition.EvaluateOnExitProperty
Specifies a set of conditions to be met, and an action to take ( `RETRY` or `EXIT` ) if all conditions are met.
|
static interface |
CfnJobDefinition.FargatePlatformConfigurationProperty
The platform configuration for jobs that are running on Fargate resources.
|
static interface |
CfnJobDefinition.LinuxParametersProperty
Linux-specific modifications that are applied to the container, such as details for device mappings.
|
static interface |
CfnJobDefinition.LogConfigurationProperty
Log configuration options to send to a custom log driver for the container.
|
static interface |
CfnJobDefinition.MountPointsProperty
Details on a Docker volume mount point that's used in a job's container properties.
|
static interface |
CfnJobDefinition.NetworkConfigurationProperty
The network configuration for jobs that are running on Fargate resources.
|
static interface |
CfnJobDefinition.NodePropertiesProperty
An object representing the node properties of a multi-node parallel job.
|
static interface |
CfnJobDefinition.NodeRangePropertyProperty
An object representing the properties of the node range for a multi-node parallel job.
|
static interface |
CfnJobDefinition.ResourceRequirementProperty
The type and amount of a resource to assign to a container.
|
static interface |
CfnJobDefinition.RetryStrategyProperty
The retry strategy associated with a job.
|
static interface |
CfnJobDefinition.SecretProperty
An object representing the secret to expose to your container.
|
static interface |
CfnJobDefinition.TimeoutProperty
An object representing a job timeout configuration.
|
static interface |
CfnJobDefinition.TmpfsProperty
The container path, mount options, and size of the tmpfs mount.
|
static interface |
CfnJobDefinition.UlimitProperty
The `ulimit` settings to pass to the container.
|
static interface |
CfnJobDefinition.VolumesHostProperty
Determine whether your data volume persists on the host container instance and where it is stored.
|
static interface |
CfnJobDefinition.VolumesProperty
A list of volumes associated with the job.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnJobDefinition(software.constructs.Construct scope,
String id,
CfnJobDefinitionProps props)
Create a new `AWS::Batch::JobDefinition`.
|
protected |
CfnJobDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnJobDefinition(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
getCfnProperties() |
Object |
getContainerProperties()
An object with various properties specific to container-based jobs.
|
String |
getJobDefinitionName()
The name of the job definition.
|
Object |
getNodeProperties()
An object with various properties specific to multi-node parallel jobs.
|
Object |
getParameters()
Default parameters or parameter substitution placeholders that are set in the job definition.
|
List<String> |
getPlatformCapabilities()
The platform capabilities required by the job definition.
|
Object |
getPropagateTags()
Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.
|
Object |
getRetryStrategy()
The retry strategy to use for failed jobs that are submitted with this job definition.
|
Number |
getSchedulingPriority()
The scheduling priority of the job definition.
|
TagManager |
getTags()
The tags applied to the job definition.
|
Object |
getTimeout()
The timeout configuration for jobs that are submitted with this job definition.
|
String |
getType()
The type of job definition.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setContainerProperties(CfnJobDefinition.ContainerPropertiesProperty value)
An object with various properties specific to container-based jobs.
|
void |
setContainerProperties(IResolvable value)
An object with various properties specific to container-based jobs.
|
void |
setJobDefinitionName(String value)
The name of the job definition.
|
void |
setNodeProperties(CfnJobDefinition.NodePropertiesProperty value)
An object with various properties specific to multi-node parallel jobs.
|
void |
setNodeProperties(IResolvable value)
An object with various properties specific to multi-node parallel jobs.
|
void |
setParameters(Object value)
Default parameters or parameter substitution placeholders that are set in the job definition.
|
void |
setPlatformCapabilities(List<String> value)
The platform capabilities required by the job definition.
|
void |
setPropagateTags(Boolean value)
Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.
|
void |
setPropagateTags(IResolvable value)
Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.
|
void |
setRetryStrategy(CfnJobDefinition.RetryStrategyProperty value)
The retry strategy to use for failed jobs that are submitted with this job definition.
|
void |
setRetryStrategy(IResolvable value)
The retry strategy to use for failed jobs that are submitted with this job definition.
|
void |
setSchedulingPriority(Number value)
The scheduling priority of the job definition.
|
void |
setTimeout(CfnJobDefinition.TimeoutProperty value)
The timeout configuration for jobs that are submitted with this job definition.
|
void |
setTimeout(IResolvable value)
The timeout configuration for jobs that are submitted with this job definition.
|
void |
setType(String value)
The type of job definition.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnJobDefinition(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnJobDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnJobDefinition(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnJobDefinitionProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public Object getParameters()
Parameters are specified as a key-value pair mapping. Parameters in a SubmitJob request 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 .
@Stability(value=Stable)
public void setParameters(@NotNull
Object value)
Parameters are specified as a key-value pair mapping. Parameters in a SubmitJob request 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 .
@Stability(value=Stable) @NotNull public String getType()
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.
@Stability(value=Stable)
public void setType(@NotNull
String value)
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.
@Stability(value=Stable) @Nullable public Object getContainerProperties()
@Stability(value=Stable)
public void setContainerProperties(@Nullable
CfnJobDefinition.ContainerPropertiesProperty value)
@Stability(value=Stable)
public void setContainerProperties(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getJobDefinitionName()
@Stability(value=Stable)
public void setJobDefinitionName(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getNodeProperties()
If the job runs on Fargate resources, then you must not specify
nodeProperties; usecontainerPropertiesinstead.
@Stability(value=Stable)
public void setNodeProperties(@Nullable
CfnJobDefinition.NodePropertiesProperty value)
If the job runs on Fargate resources, then you must not specify
nodeProperties; usecontainerPropertiesinstead.
@Stability(value=Stable)
public void setNodeProperties(@Nullable
IResolvable value)
If the job runs on Fargate resources, then you must not specify
nodeProperties; usecontainerPropertiesinstead.
@Stability(value=Stable) @Nullable public List<String> getPlatformCapabilities()
If no value is specified, it defaults to EC2 . Jobs run on Fargate resources specify FARGATE .
@Stability(value=Stable)
public void setPlatformCapabilities(@Nullable
List<String> value)
If no value is specified, it defaults to EC2 . Jobs run on Fargate resources specify FARGATE .
@Stability(value=Stable) @Nullable public Object getPropagateTags()
If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks during task creation. 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 FAILED state.
@Stability(value=Stable)
public void setPropagateTags(@Nullable
Boolean value)
If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks during task creation. 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 FAILED state.
@Stability(value=Stable)
public void setPropagateTags(@Nullable
IResolvable value)
If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks during task creation. 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 FAILED state.
@Stability(value=Stable) @Nullable public Object getRetryStrategy()
@Stability(value=Stable)
public void setRetryStrategy(@Nullable
CfnJobDefinition.RetryStrategyProperty value)
@Stability(value=Stable)
public void setRetryStrategy(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Number getSchedulingPriority()
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.
@Stability(value=Stable)
public void setSchedulingPriority(@Nullable
Number value)
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.
@Stability(value=Stable) @Nullable public Object getTimeout()
You can specify a timeout duration after which AWS Batch terminates your jobs if they haven't finished.
@Stability(value=Stable)
public void setTimeout(@Nullable
CfnJobDefinition.TimeoutProperty value)
You can specify a timeout duration after which AWS Batch terminates your jobs if they haven't finished.
@Stability(value=Stable)
public void setTimeout(@Nullable
IResolvable value)
You can specify a timeout duration after which AWS Batch terminates your jobs if they haven't finished.
Copyright © 2022. All rights reserved.