RetryStrategyProperty Struct
The retry strategy that's associated with a job.
For more information, see Automated job retries in the AWS Batch User Guide .
| Source | |
|---|---|
| Type last changed |
Example
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
# 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
// 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();
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"
} }
};
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
attemptsoptionalnumberattemptsoptionalint | floatattemptsoptionalNumberAttemptsoptionaldoubleAttemptsoptional*float64 #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.
evaluateOnExitoptionalIResolvable | IResolvable | CfnJobDefinition.evaluate_on_exitoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, EvaluateOnExitProperty]]]evaluateOnExitoptionalIResolvableEvaluateOnExitoptionalIResolvableEvaluateOnExitoptionalinterface{} #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.