# TriggerOptions

Options for `Trigger`.

- Source: [`triggers/lib/trigger.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/triggers/lib/trigger.ts#L32)
- Type last changed: v2.15.0 · 1 Mar 2022

## Example

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

declare const construct: constructs.Construct;
const triggerOptions: triggers.TriggerOptions = {
  executeAfter: [construct],
  executeBefore: [construct],
  executeOnHandlerChange: false,
};
```

## Properties

- `executeAfter`: [Construct](/cdk/api/v2/docs/constructs.Construct.html)[] = [] — Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned.

  You can also use `trigger.executeAfter()` to add additional dependencies.

- `executeBefore`: [Construct](/cdk/api/v2/docs/constructs.Construct.html)[] = [] — Adds this trigger as a dependency on other constructs.

  This means that this
  trigger will get executed *before* the given construct(s).

  You can also use `trigger.executeBefore()` to add additional dependents.

- `executeOnHandlerChange`: boolean = true — Re-executes the trigger every time the handler changes.

  This implies that the trigger is associated with the `currentVersion` of
  the handler, which gets recreated every time the handler or its
  configuration is updated.
