Interface CustomReason
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CustomReason.Jsii$Proxy
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-09-18T22:16:52.524Z")
@Stability(Stable)
public interface CustomReason
extends software.amazon.jsii.JsiiSerializable
The corresponding Action will only be taken if all of the conditions specified here are met.
Example:
EcsJobDefinition jobDefn = EcsJobDefinition.Builder.create(this, "JobDefn") .container(EcsEc2ContainerDefinition.Builder.create(this, "containerDefn") .image(ContainerImage.fromRegistry("public.ecr.aws/amazonlinux/amazonlinux:latest")) .memory(Size.mebibytes(2048)) .cpu(256) .build()) .retryAttempts(5) .retryStrategies(List.of(RetryStrategy.of(Action.EXIT, Reason.CANNOT_PULL_CONTAINER))) .build(); jobDefn.addRetryStrategy(RetryStrategy.of(Action.EXIT, Reason.SPOT_INSTANCE_RECLAIMED)); jobDefn.addRetryStrategy(RetryStrategy.of(Action.EXIT, Reason.CANNOT_PULL_CONTAINER)); jobDefn.addRetryStrategy(RetryStrategy.of(Action.EXIT, Reason.custom(CustomReason.builder() .onExitCode("40*") .onReason("some reason") .build())));
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forCustomReason
static final class
An implementation forCustomReason
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomReason.Builder
builder()
default String
A glob string that will match on the job exit code.default String
A glob string that will match on the reason returned by the exiting job For example,'CannotPullContainerError*'
indicates that container needed to start the job could not be pulled.default String
A glob string that will match on the statusReason returned by the exiting job.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getOnExitCode
A glob string that will match on the job exit code.For example,
'40*'
will match 400, 404, 40123456789012Default: - will not match on the exit code
-
getOnReason
A glob string that will match on the reason returned by the exiting job For example,'CannotPullContainerError*'
indicates that container needed to start the job could not be pulled.Default: - will not match on the reason
-
getOnStatusReason
A glob string that will match on the statusReason returned by the exiting job.For example,
'Host EC2*'
indicates that the spot instance has been reclaimed.Default: - will not match on the status reason
-
builder
- Returns:
- a
CustomReason.Builder
ofCustomReason
-