Skip to content

Commit

Permalink
Add missing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DerkSch committed Dec 1, 2022
1 parent d8b43b4 commit f47db06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/@aws-cdk/triggers/lib/trigger.ts
Expand Up @@ -62,6 +62,9 @@ export interface TriggerOptions {
readonly executeOnHandlerChange?: boolean;
}

/**
* The invocation type to apply to a trigger. This determines whether the trigger function should await the result of the to be triggered function or not.
*/
export enum InvocationType {
/**
* Invoke the function synchronously. Keep the connection open until the function returns a response or times out.
Expand Down
7 changes: 4 additions & 3 deletions packages/@aws-cdk/triggers/test/integ.triggers.ts
Expand Up @@ -11,16 +11,17 @@ const topic1 = new sns.Topic(stack, 'Topic1');
const topic2 = new sns.Topic(stack, 'Topic2');

const triggerFunction = new triggers.TriggerFunction(stack, 'MyTriggerFunction', {
runtime: lambda.Runtime.NODEJS_14_X,
runtime: lambda.Runtime.NODEJS_16_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function() { console.log("hi"); };'),
executeBefore: [topic1],
});

const func = new lambda.Function(stack, 'MyLambdaFunction', {
runtime: lambda.Runtime.NODEJS_14_X,
runtime: lambda.Runtime.NODEJS_16_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function() { console.log("hi"); };'),
timeout: Duration.minutes(15),
code: lambda.Code.fromInline('exports.handler = function() { await setTimeout(3*60*1000, "hi"); };'),
});

const trigger = new triggers.Trigger(stack, 'MyTrigger', {
Expand Down

0 comments on commit f47db06

Please sign in to comment.