Interface CustomReason
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CustomReason.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:33.335Z")
@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
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCustomReasonstatic final classAn implementation forCustomReason -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomReason.Builderbuilder()default StringA glob string that will match on the job exit code.default StringA 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 StringA 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.BuilderofCustomReason
-