-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.mcall.ts
115 lines (110 loc) · 2.57 KB
/
serverless.mcall.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* eslint-disable @typescript-eslint/no-restricted-imports */
import type { AWS } from '@serverless/typescript'
import { baseServerlessConfiguration } from './serverless.base'
const serverlessConfiguration: AWS = {
...baseServerlessConfiguration,
service: 'mcall',
provider: {
...baseServerlessConfiguration.provider,
name: 'aws',
region: 'eu-central-1',
deploymentBucket: { name: "mcbrokenio-mcall-bucket-${opt:stage, 'dev'}" },
iam: {
role: {
statements: [
{
Effect: 'Allow',
Action: ['s3:PutObject', 's3:PutObjectAcl', 's3:GetObject'],
Resource: ['arn:aws:s3:::*']
}
]
}
}
},
functions: {
getAllStores: {
memorySize: 368,
timeout: 900,
handler: 'src/stacks/mcall/getAllStores.handler',
events: [
{
schedule: 'cron(05 0 ? * SUN *)'
}
],
environment: {
BASIC_TOKEN_EU: '${env:BASIC_TOKEN_EU}',
DATABASE_URL: '${env:DATABASE_URL}',
KEY: '${env:KEY}'
}
},
getItemStatusEu: {
memorySize: 368,
timeout: 900,
handler: 'src/stacks/mcall/getItemStatus.handlerEu',
events: [
{
schedule: 'cron(5 * * * ? *)'
}
],
environment: {
BASIC_TOKEN_EU: '${env:BASIC_TOKEN_EU}',
DATABASE_URL: '${env:DATABASE_URL}'
}
},
getItemStatusEl: {
memorySize: 368,
timeout: 900,
handler: 'src/stacks/mcall/getItemStatus.handlerEl',
events: [
{
schedule: 'cron(20 * * * ? *)'
}
],
environment: {
DATABASE_URL: '${env:DATABASE_URL}',
KEY: '${env:KEY}'
}
},
createJson: {
memorySize: 368,
timeout: 60,
handler: 'src/stacks/mcall/createJson.handler',
events: [
{
schedule: 'cron(0/15 * * * ? *)'
}
],
environment: {
DATABASE_URL: '${env:DATABASE_URL}',
EXPORT_BUCKET: '${env:EXPORT_BUCKET}'
}
},
getLocation: {
handler: 'src/stacks/mcall/getLocation.handler',
memorySize: 128,
timeout: 5,
events: [
{
http: {
method: 'get',
path: '/',
cors: true
}
}
]
}
},
custom: {
esbuild: {
bundle: true,
minify: false,
sourcemap: true,
exclude: ['aws-sdk'],
target: 'node18',
define: { 'require.resolve': undefined },
platform: 'node',
concurrency: 10
}
}
}
module.exports = serverlessConfiguration