Interface Conditions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
FailureConditions
- All Known Implementing Classes:
Conditions.Jsii$Proxy,FailureConditions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-04T09:27:36.919Z")
@Stability(Stable)
public interface Conditions
extends software.amazon.jsii.JsiiSerializable
The conditions for making checks for the stage.
Example:
CodeStarConnectionsSourceAction sourceAction;
CodeBuildAction buildAction;
Pipeline.Builder.create(this, "Pipeline")
.pipelineType(PipelineType.V2)
.stages(List.of(StageProps.builder()
.stageName("Source")
.actions(List.of(sourceAction))
.build(), StageProps.builder()
.stageName("Build")
.actions(List.of(buildAction))
// BeforeEntry condition - checks before entering the stage
.beforeEntry(Conditions.builder()
.conditions(List.of(Condition.builder()
.rules(List.of(Rule.Builder.create()
.name("LambdaCheck")
.provider("LambdaInvoke")
.version("1")
.configuration(Map.of(
"FunctionName", "LambdaFunctionName"))
.build()))
.result(Result.FAIL)
.build()))
.build())
// OnSuccess condition - checks after successful stage completion
.onSuccess(Conditions.builder()
.conditions(List.of(Condition.builder()
.result(Result.FAIL)
.rules(List.of(Rule.Builder.create()
.name("CloudWatchCheck")
.provider("LambdaInvoke")
.version("1")
.configuration(Map.of(
"AlarmName", "AlarmName1",
"WaitTime", "300", // 5 minutes
"FunctionName", "funcName2"))
.build()))
.build()))
.build())
// OnFailure condition - handles stage failure
.onFailure(FailureConditions.builder()
.conditions(List.of(Condition.builder()
.result(Result.ROLLBACK)
.rules(List.of(Rule.Builder.create()
.name("RollBackOnFailure")
.provider("LambdaInvoke")
.version("1")
.configuration(Map.of(
"AlarmName", "Alarm",
"WaitTime", "300", // 5 minutes
"FunctionName", "funcName1"))
.build()))
.build()))
.build())
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forConditionsstatic final classAn implementation forConditions -
Method Summary
Modifier and TypeMethodDescriptionstatic Conditions.Builderbuilder()The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getConditions
The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage.Default: - No conditions are configured
-
builder
- Returns:
- a
Conditions.BuilderofConditions
-