AWS::Batch::JobDefinition RetryStrategy - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::Batch::JobDefinition RetryStrategy

The retry strategy that's associated with a job. For more information, see Automated job retries in the Amazon Batch User Guide.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Attempts" : Integer, "EvaluateOnExit" : [ EvaluateOnExit, ... ] }

Properties

Attempts

The number of times to move a job to the RUNNABLE status. You can specify between 1 and 10 attempts. If the value of attempts is greater than one, the job is retried on failure the same number of attempts as the value.

Required: No

Type: Integer

Update requires: No interruption

EvaluateOnExit

Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter is specified, then the attempts parameter must also be specified. If none of the listed conditions match, then the job is retried.

Required: No

Type: Array of EvaluateOnExit

Update requires: No interruption

Examples

Retrying jobs

This example will retry the job attempt up to 3 times if the job status reason is either AGENT or Task failed to start. The final rule matches all other job failures and exits. If none of the entries in EvaluateOnExit match the job failure, the job will be retried.

YAML

RetryStrategy: Attempts: 3 EvaluateOnExit: - Action: RETRY OnReason: AGENT - Action: RETRY OnReason: Task failed to start - Action: EXIT OnReason: "*"

JSON

{ "Attempts": 3, "EvaluateOnExit": [ { "Action": "RETRY", "OnReason": "AGENT" }, { "Action": "RETRY", "OnReason": "Task failed to start" }, { "Action": "EXIT", "OnReason": "*" } ] }