Skip to content
v2.278.0

Condition Struct ​

The condition for the stage.

A condition is made up of the rules and the result for the condition.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codepipeline as codepipeline } from 'aws-cdk-lib';

declare const rule: codepipeline.Rule;
const condition: codepipeline.Condition = {
  result: codepipeline.Result.ROLLBACK,
  rules: [rule],
};
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_codepipeline as codepipeline

# rule: codepipeline.Rule

condition = codepipeline.Condition(
    result=codepipeline.Result.ROLLBACK,
    rules=[rule]
)
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.codepipeline.*;

Rule rule;

Condition condition = Condition.builder()
        .result(Result.ROLLBACK)
        .rules(List.of(rule))
        .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.CodePipeline;

Rule rule;

var condition = new Condition {
    Result = Result.ROLLBACK,
    Rules = new [] { rule }
};
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"

var rule Rule

condition := &Condition{
	Result: awscdk.Aws_codepipeline.Result_ROLLBACK,
	Rules: []Rule{
		rule,
	},
}

Properties ​

resultoptionalResultresultoptionalResultresultoptionalResultResultoptionalResultResultoptionalResult #
The action to be done when the condition is met.

Default: No result action is taken

rulesoptionalRule[]rulesoptionaltyping.List[Rule]rulesoptionalList<Rule>RulesoptionalRule[]Rulesoptional*[]Rule #
The rules that make up the condition.

Default: No rules are applied