Created
June 8, 2022 11:21
-
-
Save pubudusj/209b685f2f47e669a6ccc47f763d072b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lambdaFunctionOne = new nodejs_lambda.NodejsFunction(this, "LambdaFunctionOne", { | |
runtime: lambda.Runtime.NODEJS_14_X, | |
entry: path.join(__dirname, `/../lambda/FunctionOne/index.ts`), | |
handler: "handler", | |
timeout: Duration.minutes(10), | |
}); | |
const waitForXMinutes = new sfn.Wait(this, 'Wait', { | |
time: sfn.WaitTime.duration(Duration.minutes(3)), | |
}); | |
const lambdaFunctionTwo = new nodejs_lambda.NodejsFunction(this, "LambdaFunctionTwo", { | |
runtime: lambda.Runtime.NODEJS_14_X, | |
entry: path.join(__dirname, `/../lambda/FunctionTwo/index.ts`), | |
handler: "handler", | |
timeout: Duration.minutes(10), | |
}); | |
const stateMachine = new sfn.StateMachine(this, 'SfTestStateMachine', { | |
definition: new tasks.LambdaInvoke(this, 'TriggerLambdaFunctionOne', { | |
lambdaFunction: lambdaFunctionOne | |
}) | |
.next(waitForXMinutes) | |
.next( | |
new tasks.LambdaInvoke(this, 'TriggerLambdaFunctionTwo', { | |
lambdaFunction: lambdaFunctionTwo | |
}) | |
) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment