-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.ts
More file actions
52 lines (49 loc) · 1.19 KB
/
serverless.ts
File metadata and controls
52 lines (49 loc) · 1.19 KB
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
import type { AWS } from "@serverless/typescript";
import { resources } from "./resources";
const serverlessConfig: Partial<AWS> = {
service: "discord-bot",
configValidationMode: "error",
frameworkVersion: "3",
package: {
individually: true,
},
custom: {
region: {
dev: "us-east-2",
local: "us-east-2",
production: "us-east-1",
},
webpack: {
webpackConfig: "webpack.resources.config.js"
},
},
provider: {
name: "aws",
region: "${self:custom.region.${opt:stage, 'local'}}" as any,
runtime: "nodejs16.x",
memorySize: 512,
timeout: 5,
logRetentionInDays: process.env.NODE_ENV === "production" ? 3 : 1,
apiGateway: {
minimumCompressionSize: 1024,
shouldStartNameWithService: false,
},
environment: {
STACK_NAME: "${self:service}-${opt:stage, 'local'}",
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1",
NODE_ENV: "${opt:stage, 'local'}",
CLOUD_REGION: "${self:provider.region}",
},
tags: {
costs: "${self:service}-${opt:stage, 'local'}",
environment: "${opt:stage, 'local'}",
},
stackTags: {
costs: "${self:service}-${opt:stage, 'local'}",
environment: "${opt:stage, 'local'}",
},
},
resources,
};
//@ts-ignore
export = serverlessConfig;