# Trigger

Trigger.

- Source: [`aws-codepipeline/lib/trigger.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-codepipeline/lib/trigger.ts#L197)
- Type last changed: v2.128.0 · 14 Feb 2024

## 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 action: codepipeline.Action;
const trigger = new codepipeline.Trigger({
  providerType: codepipeline.ProviderType.CODE_STAR_SOURCE_CONNECTION,

  // the properties below are optional
  gitConfiguration: {
    sourceAction: action,

    // the properties below are optional
    pullRequestFilter: [{
      branchesExcludes: ['branchesExcludes'],
      branchesIncludes: ['branchesIncludes'],
      events: [codepipeline.GitPullRequestEvent.OPEN],
      filePathsExcludes: ['filePathsExcludes'],
      filePathsIncludes: ['filePathsIncludes'],
    }],
    pushFilter: [{
      branchesExcludes: ['branchesExcludes'],
      branchesIncludes: ['branchesIncludes'],
      filePathsExcludes: ['filePathsExcludes'],
      filePathsIncludes: ['filePathsIncludes'],
      tagsExcludes: ['tagsExcludes'],
      tagsIncludes: ['tagsIncludes'],
    }],
  },
});
```

## Initializer

```ts
new Trigger(props: TriggerProps)
```

## Properties

- `sourceAction`: [IAction](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.IAction.html) — The pipeline source action where the trigger configuration.
