Last active
June 8, 2022 10:33
-
-
Save pubudusj/36df41c7b0d4cd6a838fd0708b8056a0 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: new lambda.Version(this, 'LambdaFunctionOneVersion', { | |
lambda: lambdaFunctionOne, | |
}) | |
}) | |
.next(waitForXMinutes) | |
.next( | |
new tasks.LambdaInvoke(this, 'TriggerLambdaFunctionTwo', { | |
lambdaFunction: new lambda.Version(this, 'LambdaFunctionTwoVersion', { | |
lambda: lambdaFunctionTwo, | |
}) | |
}) | |
) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment