Class TriggerProps
Props for Trigger
.
Inheritance
Namespace: Amazon.CDK.Triggers
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class TriggerProps : Object, ITriggerProps, ITriggerOptions
Syntax (vb)
Public Class TriggerProps
Inherits Object
Implements ITriggerProps, ITriggerOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.Triggers;
var func = new Function(this, "MyFunction", new FunctionProps {
Handler = "index.handler",
Runtime = Runtime.NODEJS_18_X,
Code = Code.FromInline("foo")
});
new Trigger(this, "MyTrigger", new TriggerProps {
Handler = func,
Timeout = Duration.Minutes(10),
InvocationType = InvocationType.EVENT
});
Synopsis
Constructors
TriggerProps() |
Properties
ExecuteAfter | Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned. |
ExecuteBefore | Adds this trigger as a dependency on other constructs. |
ExecuteOnHandlerChange | Re-executes the trigger every time the handler changes. |
Handler | The AWS Lambda function of the handler to execute. |
InvocationType | The invocation type to invoke the Lambda function with. |
Timeout | The timeout of the invocation call of the Lambda function to be triggered. |
Constructors
TriggerProps()
public TriggerProps()
Properties
ExecuteAfter
Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned.
public Construct[] ExecuteAfter { get; set; }
Property Value
Constructs.Construct[]
Remarks
You can also use trigger.executeAfter()
to add additional dependencies.
Default: []
ExecuteBefore
Adds this trigger as a dependency on other constructs.
public Construct[] ExecuteBefore { get; set; }
Property Value
Constructs.Construct[]
Remarks
This means that this trigger will get executed before the given construct(s).
You can also use trigger.executeBefore()
to add additional dependants.
Default: []
ExecuteOnHandlerChange
Re-executes the trigger every time the handler changes.
public Nullable<bool> ExecuteOnHandlerChange { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
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.
Default: true
Handler
The AWS Lambda function of the handler to execute.
public Function Handler { get; set; }
Property Value
InvocationType
The invocation type to invoke the Lambda function with.
public Nullable<InvocationType> InvocationType { get; set; }
Property Value
System.Nullable<InvocationType>
Remarks
Default: RequestResponse
Timeout
The timeout of the invocation call of the Lambda function to be triggered.
public Duration Timeout { get; set; }
Property Value
Remarks
Default: Duration.minutes(2)