Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createTask(handler: lambda.Function) {
return new sfn.Task(this, `${handler.node.id}-task`, {
task: new tasks.InvokeFunction(handler),
});
}
}
export const task = (
scope: cdk.Construct,
name: string,
desc: string,
{ retry, ...lambdaParams }: Params,
environment?: { [key: string]: string },
overrides?: Partial,
) => {
const lambda = taskLambda(scope, name, lambdaParams, environment, overrides)
const task = new sfn.Task(scope, [name, desc].join(': '), {
task: new tasks.InvokeFunction(lambda),
})
if (retry == true) {
task.addRetry(retry === true ? {} : retry)
}
return { lambda, task }
}