@aws-cdk_aws-batch-alpha.IJobDefinition

interface IJobDefinition ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Batch.Alpha.IJobDefinition
Gogithub.com/aws/aws-cdk-go/awscdkbatchalpha/v2#IJobDefinition
Javasoftware.amazon.awscdk.services.batch.alpha.IJobDefinition
Pythonaws_cdk.aws_batch_alpha.IJobDefinition
TypeScript (source)@aws-cdk/aws-batch-alpha ยป IJobDefinition

Implemented by EcsJobDefinition, EksJobDefinition, MultiNodeJobDefinition

Obtainable from EcsJobDefinition.fromJobDefinitionArn(), MultiNodeJobDefinition.fromJobDefinitionArn()

Represents a JobDefinition.

Properties

NameTypeDescription
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
jobDefinitionArn๐Ÿ”นstringThe ARN of this job definition.
jobDefinitionName๐Ÿ”นstringThe name of this job definition.
node๐Ÿ”นNodeThe tree node.
retryStrategies๐Ÿ”นRetryStrategy[]Defines the retry behavior for this job.
stack๐Ÿ”นStackThe stack in which this resource is defined.
parameters?๐Ÿ”น{ [string]: any }The default parameters passed to the container These parameters can be referenced in the command that you give to the container.
retryAttempts?๐Ÿ”นnumberThe number of times to retry a job.
schedulingPriority?๐Ÿ”นnumberThe priority of this Job.
timeout?๐Ÿ”นDurationThe timeout time for jobs that are submitted with this job definition.

env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


jobDefinitionArn๐Ÿ”น

Type: string

The ARN of this job definition.


jobDefinitionName๐Ÿ”น

Type: string

The name of this job definition.


node๐Ÿ”น

Type: Node

The tree node.


retryStrategies๐Ÿ”น

Type: RetryStrategy[]

Defines the retry behavior for this job.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


parameters?๐Ÿ”น

Type: { [string]: any } (optional, default: none)

The default parameters passed to the container These parameters can be referenced in the command that you give to the container.

See also: https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html#parameters


retryAttempts?๐Ÿ”น

Type: number (optional, default: 1)

The number of times to retry a job.

The job is retried on failure the same number of attempts as the value.


schedulingPriority?๐Ÿ”น

Type: number (optional, default: 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.


timeout?๐Ÿ”น

Type: Duration (optional, default: no timeout)

The timeout time for jobs that are submitted with this job definition.

After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.

Methods

NameDescription
addRetryStrategy(strategy)๐Ÿ”นAdd a RetryStrategy to this JobDefinition.
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.

addRetryStrategy(strategy)๐Ÿ”น

public addRetryStrategy(strategy: RetryStrategy): void

Parameters

  • strategy RetryStrategy

Add a RetryStrategy to this JobDefinition.


applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).