IEksJobDefinition

class aws_cdk.aws_batch.IEksJobDefinition(*args, **kwargs)

Bases: IJobDefinition, Protocol

A JobDefinition that uses Eks orchestration.

Methods

add_retry_strategy(strategy)

Add a RetryStrategy to this JobDefinition.

Parameters:

strategy (RetryStrategy) –

Return type:

None

apply_removal_policy(policy)

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

Parameters:

policy (RemovalPolicy) –

Return type:

None

Attributes

container

The container this Job Definition will run.

dns_policy

The DNS Policy of the pod used by this Job Definition.

Default:

DnsPolicy.CLUSTER_FIRST

See:

https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy

env

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.

job_definition_arn

The ARN of this job definition.

Attribute:

true

job_definition_name

The name of this job definition.

Attribute:

true

node

The tree node.

parameters

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

Default:

none

See:

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

retry_attempts

The number of times to retry a job.

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

Default:

1

retry_strategies

Defines the retry behavior for this job.

Default:
  • no RetryStrategy

scheduling_priority

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.

Default:

none

service_account

The name of the service account that’s used to run the container.

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

Default:
  • the default service account of the container

See:

https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html

stack

The stack in which this resource is defined.

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.

Default:
  • no timeout

use_host_network

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.

Default:

true

See:

https://kubernetes.io/docs/concepts/workloads/pods/#pod-networking