# RetryStrategyProperty

The retry strategy that's associated with a job.

For more information, see [Automated job retries](https://docs.aws.amazon.com/batch/latest/userguide/job_retries.html) in the *AWS Batch User Guide* .

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_batch as batch } from 'aws-cdk-lib';
const retryStrategyProperty: batch.CfnJobDefinition.RetryStrategyProperty = {
  attempts: 123,
  evaluateOnExit: [{
    action: 'action',

    // the properties below are optional
    onExitCode: 'onExitCode',
    onReason: 'onReason',
    onStatusReason: 'onStatusReason',
  }],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_batch as batch

retry_strategy_property = batch.CfnJobDefinition.RetryStrategyProperty(
    attempts=123,
    evaluate_on_exit=[batch.CfnJobDefinition.EvaluateOnExitProperty(
        action="action",

        # the properties below are optional
        on_exit_code="onExitCode",
        on_reason="onReason",
        on_status_reason="onStatusReason"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.batch.*;

RetryStrategyProperty retryStrategyProperty = RetryStrategyProperty.builder()
        .attempts(123)
        .evaluateOnExit(List.of(EvaluateOnExitProperty.builder()
                .action("action")

                // the properties below are optional
                .onExitCode("onExitCode")
                .onReason("onReason")
                .onStatusReason("onStatusReason")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Batch;

var retryStrategyProperty = new RetryStrategyProperty {
    Attempts = 123,
    EvaluateOnExit = new [] { new EvaluateOnExitProperty {
        Action = "action",

        // the properties below are optional
        OnExitCode = "onExitCode",
        OnReason = "onReason",
        OnStatusReason = "onStatusReason"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

retryStrategyProperty := &RetryStrategyProperty{
	Attempts: jsii.Number(123),
	EvaluateOnExit: []interface{}{
		&EvaluateOnExitProperty{
			Action: jsii.String("action"),

			// the properties below are optional
			OnExitCode: jsii.String("onExitCode"),
			OnReason: jsii.String("onReason"),
			OnStatusReason: jsii.String("onStatusReason"),
		},
	},
}
```

## Properties

- `attempts`: number — 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.

- `evaluateOnExit`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnJobDefinition.EvaluateOnExitProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.CfnJobDefinition.EvaluateOnExitProperty.html)[] — 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.
