-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.ts
82 lines (78 loc) · 1.82 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
import type { AWS } from '@serverless/typescript'
import functions from '@functions/index'
import resources from '@functions/resources'
import roles from '@functions/roles'
import environment from './src/env'
const stage = environment.STAGE ?? 'local'
if (!stage) throw new Error('STAGE environment variable is not set')
const local = 'local'
const dynamoDbPort = 8448
const serverlessConfiguration: AWS = {
service: 'ssb-api',
package: {
exclude: ['./localRecipeDb/neo4j/import']
},
plugins: [
'serverless-esbuild',
'serverless-dynamodb-local',
'serverless-offline'
],
frameworkVersion: '*',
provider: {
name: 'aws',
stage,
runtime: 'nodejs16.x',
region: 'ap-southeast-2',
environment: {
STAGE: stage
}
},
functions,
custom: {
esbuild: {
bundle: true,
minify: false,
sourcemap: true,
exclude: ['aws-sdk'],
target: 'node16',
define: { 'require.resolve': undefined },
platform: 'node',
concurrency: 10
},
dynamodb: {
stages: [local],
start: {
docker: true,
migrate: true,
port: dynamoDbPort,
inMemory: true,
convertEmptyValues: true
// Uncomment only if you already have a DynamoDB running locally,
// noStart: true},
}
// TODO: Get seeds to work
// seed: {
// dev: {
// sources: [
// {
// table: "admin-users-table",
// sources: [
// {
// email: "[email protected]",
// passwordHash: "passwordHash",
// },
// ],
// },
// ],
// },
// },
}
},
resources: {
Resources: {
...resources,
...roles
}
}
}
module.exports = serverlessConfiguration