# IPipeline

The abstract view of an AWS CodePipeline as required and used by Actions.

It extends `events.IRuleTarget`,
so this interface can be used as a Target for CloudWatch Events.

Extends: [IResource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResource.html), [IPipelineRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_codepipeline.IPipelineRef.html), [INotificationRuleSource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codestarnotifications.INotificationRuleSource.html)
Implemented by: [Pipeline](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Pipeline.html)
Obtainable from: [Pipeline.fromPipelineArn](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Pipeline.html#frompipelinearn)

- Source: [`aws-codepipeline/lib/action.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-codepipeline/lib/action.ts#L203)
- Type last changed: v2.234.0 · 8 Jan 2026

## Properties

- `env`: [ResourceEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `node`: [Node](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `pipelineArn`: string — The ARN of the Pipeline.

- `pipelineName`: string — The name of the Pipeline.

- `pipelineRef`: [PipelineReference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_codepipeline.PipelineReference.html) — A reference to a Pipeline resource.

- `stack`: [Stack](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this resource is defined.

## Methods

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `bindAsNotificationRuleSource(scope: Construct): NotificationRuleSourceConfig` — Returns a source configuration for notification rule.

- `notifyOn(id: string, target: INotificationRuleTarget, options: PipelineNotifyOnOptions): INotificationRule` — Defines a CodeStar notification rule triggered when the pipeline events emitted by you specified, it very similar to `onEvent` API.

  You can also use the methods `notifyOnExecutionStateChange`, `notifyOnAnyStageStateChange`,
  `notifyOnAnyActionStateChange` and `notifyOnAnyManualApprovalStateChange`
  to define rules for these specific event emitted.

  **Parameters**

  - `id` — The id of the CodeStar notification rule.
  - `target` — The target to register for the CodeStar Notifications destination.
  - `options` — Customization options for CodeStar notification rule.

  **Returns:** CodeStar notification rule associated with this build project.

- `notifyOnAnyActionStateChange(id: string, target: INotificationRuleTarget, options?: NotificationRuleOptions): INotificationRule` — Define an notification rule triggered by the set of the "Action execution" events emitted from this pipeline.

  **Parameters**

  - `id` — Identifier for this notification handler.
  - `target` — The target to register for the CodeStar Notifications destination.
  - `options` — Additional options to pass to the notification rule.

- `notifyOnAnyManualApprovalStateChange(id: string, target: INotificationRuleTarget, options?: NotificationRuleOptions): INotificationRule` — Define an notification rule triggered by the set of the "Manual approval" events emitted from this pipeline.

  **Parameters**

  - `id` — Identifier for this notification handler.
  - `target` — The target to register for the CodeStar Notifications destination.
  - `options` — Additional options to pass to the notification rule.

- `notifyOnAnyStageStateChange(id: string, target: INotificationRuleTarget, options?: NotificationRuleOptions): INotificationRule` — Define an notification rule triggered by the set of the "Stage execution" events emitted from this pipeline.

  **Parameters**

  - `id` — Identifier for this notification handler.
  - `target` — The target to register for the CodeStar Notifications destination.
  - `options` — Additional options to pass to the notification rule.

- `notifyOnExecutionStateChange(id: string, target: INotificationRuleTarget, options?: NotificationRuleOptions): INotificationRule` — Define an notification rule triggered by the set of the "Pipeline execution" events emitted from this pipeline.

  **Parameters**

  - `id` — Identifier for this notification handler.
  - `target` — The target to register for the CodeStar Notifications destination.
  - `options` — Additional options to pass to the notification rule.

- `onEvent(id: string, options?: OnEventOptions): Rule` — Define an event rule triggered by this CodePipeline.

  **Parameters**

  - `id` — Identifier for this event handler.
  - `options` — Additional options to pass to the event rule.

- `onStateChange(id: string, options?: OnEventOptions): Rule` — Define an event rule triggered by the "CodePipeline Pipeline Execution State Change" event emitted from this pipeline.

  **Parameters**

  - `id` — Identifier for this event handler.
  - `options` — Additional options to pass to the event rule.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
