-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
65 lines (60 loc) · 1.51 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
65
service: wwwsqldesigner
custom:
stage: ${opt:stage, 'dev'}
storage:
bucket: ${env:STORAGE_S3_BUCKET}
prefix: ${env:STORAGE_S3_PREFIX, 'wwwsqldesigner/'}
statics:
bucket: ${env:STATICS_S3_BUCKET}
cf:
customDomain: ${env:CF_DOMAIN}
certificateArn: ${env:CF_CERT_ARN}
provider:
name: aws
runtime: python3.7
memorySize: 128
environment:
STORAGE_S3_BUCKET: ${self:custom.storage.bucket}
STORAGE_S3_PREFIX: ${self:custom.storage.prefix}
iamRoleStatements:
- Effect: Allow
Action: [ 's3:ListBucket' ]
Resource: arn:aws:s3:::${self:custom.storage.bucket}
- Effect: Allow
Action: [ 's3:*' ]
Resource: arn:aws:s3:::${self:custom.storage.bucket}/${self:custom.storage.prefix}*
package:
excludeDevDependencies: false
exclude:
- "**/*"
- "!src/*.py"
- "!users.json"
functions:
auth:
handler: src.authorizer.authorize
backend:
handler: src.handler.backend
events:
- http: &http_event
path: backend/s3-lambda
method: post
cors: true
authorizer:
name: auth
resultTtlInSeconds: 0
request:
parameters:
querystrings:
action: true
keyword: true
- http:
<<: *http_event
method: get
request:
parameters:
querystrings:
action: true
keyword: false
database: false
resources:
${file(serverless-resources.yml)}