TriggerOptions Struct
Options for Trigger.
| Source | triggers/lib/trigger.ts |
|---|---|
| Type last changed |
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,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import triggers
import constructs as constructs
# construct: constructs.Construct
trigger_options = triggers.TriggerOptions(
execute_after=[construct],
execute_before=[construct],
execute_on_handler_change=False
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.triggers.*;
import software.constructs.*;
Construct construct;
TriggerOptions triggerOptions = TriggerOptions.builder()
.executeAfter(List.of(construct))
.executeBefore(List.of(construct))
.executeOnHandlerChange(false)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Triggers;
using Constructs;
Construct construct;
var triggerOptions = new TriggerOptions {
ExecuteAfter = new [] { construct },
ExecuteBefore = new [] { construct },
ExecuteOnHandlerChange = false
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import constructs "github.com/aws/constructs-go/constructs"
var construct Construct
triggerOptions := &TriggerOptions{
ExecuteAfter: []Construct{
construct,
},
ExecuteBefore: []Construct{
construct,
},
ExecuteOnHandlerChange: jsii.Boolean(false),
}
Properties
executeAfteroptionalConstruct[]execute_afteroptionaltyping.List[Construct]executeAfteroptionalList<Construct>ExecuteAfteroptionalConstruct[]ExecuteAfteroptional*[]Construct = [] #Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned.
You can also use trigger.executeAfter() to add additional dependencies.
executeBeforeoptionalConstruct[]execute_beforeoptionaltyping.List[Construct]executeBeforeoptionalList<Construct>ExecuteBeforeoptionalConstruct[]ExecuteBeforeoptional*[]Construct = [] #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.
executeOnHandlerChangeoptionalbooleanexecute_on_handler_changeoptionalboolexecuteOnHandlerChangeoptionalBooleanExecuteOnHandlerChangeoptionalboolExecuteOnHandlerChangeoptional*bool = 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.