# EksJobDefinitionProps

Props for EksJobDefinition.

Extends: EksJobDefinitionProps
Extends: JobDefinitionProps
Used as props by: EksJobDefinition

- Source: [`aws-batch/lib/eks-job-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-batch/lib/eks-job-definition.ts#L60)
- Type last changed: v2.96.0 · 13 Sep 2023

## Example

```ts
const jobDefn = new batch.EksJobDefinition(this, 'eksf2', {
  container: new batch.EksContainerDefinition(this, 'container', {
    image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
    volumes: [batch.EksVolume.emptyDir({
      name: 'myEmptyDirVolume',
      mountPath: '/mount/path',
      medium: batch.EmptyDirMediumType.MEMORY,
      readonly: true,
      sizeLimit: cdk.Size.mebibytes(2048),
    })],
  }),
});
```

## Properties

- `container`: [EksContainerDefinition](/cdk/api/v2/docs/aws-cdk-lib.aws_batch.EksContainerDefinition.html) (required) — The container this Job Definition will run.

- `dnsPolicy`: [DnsPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_batch.DnsPolicy.html) = `DnsPolicy.CLUSTER_FIRST` — The DNS Policy of the pod used by this Job Definition.

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

  **Default:** generated by CloudFormation

- `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)[] — 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.

- `serviceAccount`: string — The name of the service account that's used to run the container.

  **Default:** the default service account of the container

  service accounts are Kubernetes method of identification and authentication,
  roughly analogous to IAM users.

- `skipDeregisterOnUpdate`: boolean — 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.

- `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.

- `useHostNetwork`: boolean = true — If specified, the Pod used by this Job Definition will use the host's network IP address.

  Otherwise, the Kubernetes pod networking model is enabled.
  Most AWS Batch workloads are egress-only and don't require the overhead of IP allocation for each pod for incoming connections.
