IJobDefinition

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

Bases: IResource, Protocol

Represents a JobDefinition.

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

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

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