# S3Trigger

How should the S3 Action detect changes.

This is the type of the `S3SourceAction.trigger` property.

- Source: [`aws-codepipeline-actions/lib/s3/source-action.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-codepipeline-actions/lib/s3/source-action.ts#L14)

## Example

```ts
import * as cloudtrail from 'aws-cdk-lib/aws-cloudtrail';

declare const sourceBucket: s3.Bucket;
const sourceOutput = new codepipeline.Artifact();
const key = 'some/key.zip';
const trail = new cloudtrail.Trail(this, 'CloudTrail');
trail.addS3EventSelector([{
  bucket: sourceBucket,
  objectPrefix: key,
}], {
  readWriteType: cloudtrail.ReadWriteType.WRITE_ONLY,
});
const sourceAction = new codepipeline_actions.S3SourceAction({
  actionName: 'S3Source',
  bucketKey: key,
  bucket: sourceBucket,
  output: sourceOutput,
  trigger: codepipeline_actions.S3Trigger.EVENTS, // default: S3Trigger.POLL
});
```

## Members

| Member | Description |
| --- | --- |
| `NONE` | The Action will never detect changes - the Pipeline it's part of will only begin a run when explicitly started. |
| `POLL` | CodePipeline will poll S3 to detect changes. |
| `EVENTS` | CodePipeline will use CloudWatch Events to be notified of changes. |

## Referenced by

- [`S3SourceActionProps`](/v2/docs/aws-cdk-lib.aws_codepipeline_actions.S3SourceActionProps).trigger
- [`S3SourceOptions`](/v2/docs/aws-cdk-lib.pipelines.S3SourceOptions).trigger
