-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
64 lines (54 loc) · 2.1 KB
/
serverless.yml
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
##################################################
# DVSA: a Damn Vulnerable Serverless Application #
##################################################
service: dvsa
provider:
name: aws
runtime: python2.7
stage: ${env:USER}
versionFunctions: false
region: us-east-1
timeout: 30
memorySize: 128
package:
individually: true
excludeDevDependencies: false
exclude:
- ./**
plugins:
- serverless-finch
- serverless-offline
- serverless-stack-output
- serverless-scriptable-plugin
custom:
stage: ${opt:stage, self:provider.stage}
accountId: ${file(backend/serverless/scripts/vars.js):accountId}
client:
bucketName: dvsa-website-${self:custom.accountId}
distributionFolder: client/dist
errorDocument: index.html
output:
file: ./client/src/be-stack.json
scriptHooks:
before:package:cleanup: python backend/serverless/scripts/onstart.py
after:package:finalize: python backend/serverless/scripts/verifysesaccount.py --verify
after:deploy:finalize: aws dynamodb batch-write-item --request-items file://backend/serverless/scripts/create-inventory-data.json
after:remove:remove: python backend/serverless/scripts/verifysesaccount.py --remove
functions:
- ${file(backend/src/functions/order-api/sls.yml):functions}
- ${file(backend/src/functions/order/sls.yml):functions}
- ${file(backend/src/functions/processing/sls.yml):functions}
- ${file(backend/src/functions/admin/sls.yml):functions}
- ${file(backend/src/functions/cronjobs/sls.yml):functions}
- ${file(backend/src/functions/user/sls.yml):functions}
resources:
# Resources:
- ${file(backend/serverless/resources/cognito-user-pool.yml)}
- ${file(backend/serverless/resources/cognito-identity-pool.yml)}
- ${file(backend/serverless/resources/api-gateway.yml)}
- ${file(backend/serverless/resources/dynamodb-tables.yml)}
- ${file(backend/serverless/resources/s3-buckets.yml)}
- ${file(backend/serverless/resources/function-roles.yml)}
# Function Resources
- ${file(backend/src/functions/order-api/sls.yml):resources}
- ${file(backend/src/functions/processing/sls.yml):resources}