# IJobDefinition

Represents a JobDefinition.

Extends: IJobDefinition
Extends: IResource, IJobDefinitionRef
Implemented by: EcsJobDefinition, EksJobDefinition, MultiNodeJobDefinition

- Source: [`aws-batch/lib/job-definition-base.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-batch/lib/job-definition-base.ts#L12)
- Type last changed: v2.234.0 · 8 Jan 2026

## Properties

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `jobDefinitionArn`: string (required) — The ARN of this job definition.

- `jobDefinitionName`: string (required) — The name of this job definition.

- `jobDefinitionRef`: [JobDefinitionReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_batch.JobDefinitionReference.html) (required) — A reference to a JobDefinition resource.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `parameters`: { [key: string]: any } = none — The default parameters passed to the container These parameters can be referenced in the `command` that you give to the container.

- `retryAttempts`: number = 1 — The number of times to retry a job.

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

- `retryStrategies`: [RetryStrategy](/cdk/api/v2/docs/aws-cdk-lib.aws_batch.RetryStrategy.html)[] (required) — Defines the retry behavior for this job.

  **Default:** no `RetryStrategy`

- `schedulingPriority`: number = 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.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this resource is defined.

- `timeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — 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.

## Methods

- `addRetryStrategy(strategy: RetryStrategy): void` — Add a RetryStrategy to this JobDefinition.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — 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`).

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
