forked from ryo-rm/eas-slack-build-notify
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.ts
93 lines (90 loc) · 2.58 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import type { AWS } from "@serverless/typescript";
const serverlessConfiguration: AWS = {
service: "eas-discord-webhook",
frameworkVersion: "3",
useDotenv: true,
plugins: [
"serverless-esbuild",
"serverless-offline",
"serverless-dotenv-plugin",
"serverless-better-credentials",
"serverless-plugin-warmup",
"serverless-plugin-optimize",
],
provider: {
name: "aws",
architecture: "arm64",
runtime: "nodejs16.x",
region: "us-east-1",
environment: {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1",
NODE_OPTIONS: "--enable-source-maps --stack-trace-limit=1000",
},
iam: {
role: {
statements: [
{
Effect: "Allow",
Action: ["lambda:InvokeFunction"],
Resource: ["*"],
},
],
},
},
},
custom: {
webpack: {
webpackConfig: "webpack.config.js",
packager: "pnpm",
},
esbuild: {
bundle: true,
minify: false,
sourcemap: true,
target: "node16",
exclude: ["aws-sdk", "@aws-sdk/client-lambda"],
define: { "require.resolve": undefined },
platform: "node",
concurrency: 10,
},
"serverless-offline": {
httpPort: 33031,
},
warmup: {
default: {
enabled: true,
role: "IamRoleLambdaExecution",
verbose: false, // Disable the logs
logRetentionInDays: 7,
events: [
{
schedule: "rate(5 minutes)",
},
],
cleanFolder: false,
architecture: "arm64",
prewarm: true,
},
},
},
package: {
individually: true,
patterns: [
"!.git/**",
"!.gh-assets/**",
"!README.md",
"!assets/**",
"!.github/**",
],
},
functions: {
easBuildWebhook: {
handler: "handler.handler",
events: [
{ http: { path: "/", method: "any", cors: true } },
{ http: { path: "/{proxy+}", method: "any", cors: true } },
],
},
},
};
module.exports = serverlessConfiguration;