# Condition

The condition for the stage.

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

- Source: [`aws-codepipeline/lib/pipeline.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts#L80)
- Type last changed: v2.186.0 · 27 Mar 2025

## 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],
};
```

## Properties

- `result`: [Result](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Result.html) — The action to be done when the condition is met.

  **Default:** No result action is taken

- `rules`: [Rule](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Rule.html)[] — The rules that make up the condition.

  **Default:** No rules are applied
