-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.ts
53 lines (50 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
50
51
52
53
import type { AWS } from "@serverless/typescript";
import sendEmail from "@functions/sendEmail";
import webhook from "@functions/webhook";
const serverlessConfiguration: AWS = {
service: "email-service",
frameworkVersion: "2",
useDotenv: true,
custom: {
webpack: {
webpackConfig: "./webpack.config.js",
includeModules: true,
},
},
plugins: ["serverless-webpack"],
package: {
individually: true,
},
provider: {
name: "aws",
runtime: "nodejs14.x",
apiGateway: {
minimumCompressionSize: 1024,
shouldStartNameWithService: true,
},
iam: {
role: {
statements: [
{
Effect: "Allow",
Resource: "*",
Action: "sns:*",
},
{
Effect: "Allow",
Resource: "*",
Action: "ssm:*",
},
],
},
},
environment: {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1",
},
lambdaHashingVersion: "20201221",
},
// import the function via paths
functions: { sendEmail, webhook },
configValidationMode: "error",
};
module.exports = serverlessConfiguration;