Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private addLambda() {
const name = `${this.appName}-lambda`
const conf = {
code: Code.asset(`${this.folder}/.seagull/deploy`),
description: 'universal route',
functionName: `${name}-handler`,
handler: 'dist/assets/backend/lambda.handler',
memorySize: 3008,
role: this.role,
runtime: Runtime.NodeJS810,
timeout: 300,
}
const lambdaFunction = new LambdaFunction(this, name, conf)
this.defaultIntegration = new LambdaIntegration(lambdaFunction)
}
addLambda(name: string, folder: string, role: IAM.Role, env: Keymap) {
const lambdaName = `${this.id}-${name}`
const conf = {
code: Code.asset(`${folder}/.seagull/deploy`),
description: 'universal route',
environment: env,
functionName: `${lambdaName}-handler`,
handler: 'dist/assets/backend/lambda.handler',
memorySize: 1536,
role,
runtime: Runtime.NodeJS810,
timeout: 300,
}
return new Lambda(this, lambdaName, conf)
}