JobDefinitionProps Struct
Props common to all JobDefinitions.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_batch as batch } from 'aws-cdk-lib';
declare const parameters: any;
declare const retryStrategy: batch.RetryStrategy;
const jobDefinitionProps: batch.JobDefinitionProps = {
jobDefinitionName: 'jobDefinitionName',
parameters: {
parametersKey: parameters,
},
retryAttempts: 123,
retryStrategies: [retryStrategy],
schedulingPriority: 123,
skipDeregisterOnUpdate: false,
timeout: cdk.Duration.minutes(30),
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_batch as batch
# parameters: Any
# retry_strategy: batch.RetryStrategy
job_definition_props = batch.JobDefinitionProps(
job_definition_name="jobDefinitionName",
parameters={
"parameters_key": parameters
},
retry_attempts=123,
retry_strategies=[retry_strategy],
scheduling_priority=123,
skip_deregister_on_update=False,
timeout=cdk.Duration.minutes(30)
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.batch.*;
Object parameters;
RetryStrategy retryStrategy;
JobDefinitionProps jobDefinitionProps = JobDefinitionProps.builder()
.jobDefinitionName("jobDefinitionName")
.parameters(Map.of(
"parametersKey", parameters))
.retryAttempts(123)
.retryStrategies(List.of(retryStrategy))
.schedulingPriority(123)
.skipDeregisterOnUpdate(false)
.timeout(Duration.minutes(30))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.Batch;
var parameters;
RetryStrategy retryStrategy;
var jobDefinitionProps = new JobDefinitionProps {
JobDefinitionName = "jobDefinitionName",
Parameters = new Dictionary<string, object> {
{ "parametersKey", parameters }
},
RetryAttempts = 123,
RetryStrategies = new [] { retryStrategy },
SchedulingPriority = 123,
SkipDeregisterOnUpdate = false,
Timeout = Duration.Minutes(30)
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var parameters interface{}
var retryStrategy RetryStrategy
jobDefinitionProps := &JobDefinitionProps{
JobDefinitionName: jsii.String("jobDefinitionName"),
Parameters: map[string]interface{}{
"parametersKey": parameters,
},
RetryAttempts: jsii.Number(123),
RetryStrategies: []RetryStrategy{
retryStrategy,
},
SchedulingPriority: jsii.Number(123),
SkipDeregisterOnUpdate: jsii.Boolean(false),
Timeout: cdk.Duration_Minutes(jsii.Number(30)),
}
Properties
jobDefinitionNameoptionalstringjob_definition_nameoptionalstrjobDefinitionNameoptionalStringJobDefinitionNameoptionalstringJobDefinitionNameoptional*string#The name of this job definition.
Default: generated by CloudFormation
parametersoptional{ [key: string]: any }parametersoptionaltyping.Mapping[str, Any]parametersoptionalMap<String, Object>ParametersoptionalIDictionary<string, object>Parametersoptional*map[string]interface{}= none#The default parameters passed to the container These parameters can be referenced in the `command` that you give to the container.
retryAttemptsoptionalnumberretry_attemptsoptionalint | floatretryAttemptsoptionalNumberRetryAttemptsoptionaldoubleRetryAttemptsoptional*float64= 1#The number of times to retry a job.
The job is retried on failure the same number of attempts as the value.
retryStrategiesoptionalRetryStrategy[]retry_strategiesoptionaltyping.List[RetryStrategy]retryStrategiesoptionalList<RetryStrategy>RetryStrategiesoptionalRetryStrategy[]RetryStrategiesoptional*[]RetryStrategy#Defines the retry behavior for this job.
Default: no RetryStrategy
schedulingPriorityoptionalnumberscheduling_priorityoptionalint | floatschedulingPriorityoptionalNumberSchedulingPriorityoptionaldoubleSchedulingPriorityoptional*float64= none#The priority of this Job.
Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.
skipDeregisterOnUpdateoptionalbooleanskip_deregister_on_updateoptionalboolskipDeregisterOnUpdateoptionalBooleanSkipDeregisterOnUpdateoptionalboolSkipDeregisterOnUpdateoptional*bool#Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource.
Default: undefined - AWS Batch default is false
When the property is set to false, the previous revision of the job definition is de-registered after a new revision is created. When the property is set to true, the previous revision of the job definition is not de-registered.
timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration#The timeout time for jobs that are submitted with this job definition.
Default: no timeout
After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.