forked from sutt0n/serverless-clamav-lambda-layer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.ts
executable file
·50 lines (44 loc) · 1.13 KB
/
serverless.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import type {AWS} from '@serverless/typescript';
import * as dotenv from "dotenv";
import virusScan from "@functions/virus-scan";
dotenv.config({path: __dirname + `/${process.env.NODE_ENV}.env`});
const service = 'clamav-lambda-layer';
const serverlessConfiguration: AWS = {
service: `${service}`,
frameworkVersion: '3',
useDotenv: true,
plugins: [
'serverless-webpack',
'serverless-dotenv-plugin',
'serverless-iam-roles-per-function'],
provider: {
name: 'aws',
runtime: 'nodejs16.x',
region: 'ap-southeast-2',
httpApi: {
cors: true,
},
apiGateway: {
minimumCompressionSize: 1024,
shouldStartNameWithService: true,
},
environment: {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
},
},
functions: {
virusScan
},
layers: {
clamav: {
path: 'layer'
}
},
custom: {
webpack: {
webpackConfig: './webpack.config.js',
includeModules: true,
},
},
};
module.exports = serverlessConfiguration;