-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.mcus.ts
105 lines (100 loc) · 2.4 KB
/
serverless.mcus.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
/* eslint-disable @typescript-eslint/no-restricted-imports */
import type { AWS } from '@serverless/typescript'
import { baseServerlessConfiguration } from './serverless.base'
const serverlessConfiguration: AWS = {
...baseServerlessConfiguration,
service: 'mcus',
provider: {
...baseServerlessConfiguration.provider,
name: 'aws',
region: 'us-east-2',
deploymentBucket: { name: "mcbrokenio-mcus-bucket-${opt:stage, 'dev'}" },
iam: {
role: {
statements: [
{
Effect: 'Allow',
Action: ['s3:PutObject', 's3:PutObjectAcl', 's3:GetObject'],
Resource: ['arn:aws:s3:::*']
}
]
}
}
},
functions: {
getAllStores: {
memorySize: 512,
timeout: 900,
handler: 'src/stacks/mcus/getAllStores.handler',
events: [
{
schedule: {
rate: ['cron(35 0 ? * SUN *)'],
input: { countries: ['US'] }
}
},
{
schedule: {
rate: ['cron(35 1 ? * SUN *)'],
input: { countries: ['US2'] }
}
},
{
schedule: {
rate: ['cron(35 2 ? * SUN *)'],
input: { countries: ['US3'] }
}
},
{
schedule: {
rate: ['cron(35 3 ? * SUN *)'],
input: { countries: ['US4'] }
}
},
{
schedule: {
rate: ['cron(35 4 ? * SUN *)'],
input: { countries: ['US5'] }
}
},
{
schedule: {
rate: ['cron(35 5 ? * SUN *)'],
input: { countries: ['US6'] }
}
}
],
environment: {
DATABASE_URL: '${env:DATABASE_URL}',
BASIC_TOKEN_US: '${env:BASIC_TOKEN_US}'
}
},
getItemStatus: {
memorySize: 368,
timeout: 900,
handler: 'src/stacks/mcus/getItemStatus.handler',
events: [
{
schedule: 'cron(0/30 * * * ? *)'
}
],
environment: {
DATABASE_URL: '${env:DATABASE_URL}',
BASIC_TOKEN_US: '${env:BASIC_TOKEN_US}'
}
}
},
custom: {
esbuild: {
bundle: true,
minify: false,
sourcemap: true,
exclude: ['aws-sdk'],
target: 'node18',
define: { 'require.resolve': undefined },
platform: 'node',
concurrency: 10
}
}
}
module.exports = serverlessConfiguration