Interface IConditions
The conditions for making checks for the stage.
Namespace: Amazon.CDK.AWS.CodePipeline
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IConditions
Syntax (vb)
Public Interface IConditions
Remarks
ExampleMetadata: infused
Examples
CodeStarConnectionsSourceAction sourceAction;
CodeBuildAction buildAction;
new Pipeline(this, "Pipeline", new PipelineProps {
PipelineType = PipelineType.V2,
Stages = new [] { new StageProps {
StageName = "Source",
Actions = new [] { sourceAction }
}, new StageProps {
StageName = "Build",
Actions = new [] { buildAction },
// BeforeEntry condition - checks before entering the stage
BeforeEntry = new Conditions {
Conditions = new [] { new Condition {
Rules = new [] { new Rule(new RuleProps {
Name = "LambdaCheck",
Provider = "LambdaInvoke",
Version = "1",
Configuration = new Dictionary<string, string> {
{ "FunctionName", "LambdaFunctionName" }
}
}) },
Result = Result.FAIL
} }
},
// OnSuccess condition - checks after successful stage completion
OnSuccess = new Conditions {
Conditions = new [] { new Condition {
Result = Result.FAIL,
Rules = new [] { new Rule(new RuleProps {
Name = "CloudWatchCheck",
Provider = "LambdaInvoke",
Version = "1",
Configuration = new Dictionary<string, string> {
{ "AlarmName", "AlarmName1" },
{ "WaitTime", "300" }, // 5 minutes
{ "FunctionName", "funcName2" }
}
}) }
} }
},
// OnFailure condition - handles stage failure
OnFailure = new FailureConditions {
Conditions = new [] { new Condition {
Result = Result.ROLLBACK,
Rules = new [] { new Rule(new RuleProps {
Name = "RollBackOnFailure",
Provider = "LambdaInvoke",
Version = "1",
Configuration = new Dictionary<string, string> {
{ "AlarmName", "Alarm" },
{ "WaitTime", "300" }, // 5 minutes
{ "FunctionName", "funcName1" }
}
}) }
} }
}
} }
});
Synopsis
Properties
Conditions | The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage. |
Properties
Conditions
The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage.
virtual ICondition[] Conditions { get; }
Property Value
Remarks
Default: - No conditions are configured