-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
61 lines (56 loc) · 1.29 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
service: codear-api
plugins:
- serverless-python-requirements
- serverless-wsgi
resources:
Resources:
DBBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.dbBucket}
custom:
stage: ${opt:stage, self:provider.stage}
dbBucket: "${self:service}-db-${self:custom.stage}"
wsgi:
app: codear.wsgi.application
packRequirements: false
pythonRequirements:
dockerizePip: non-linux
provider:
name: aws
region: sa-east-1
runtime: python3.8
stage: development
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*Object"
Resource:
Fn::Join:
- ""
- - Fn::GetAtt:
- DBBucket
- Arn
- "/*"
functions:
app:
handler: wsgi_handler.handler
environment:
SQLITE_BUCKET: ${self:custom.dbBucket}
SERVERLESS_STAGE: ${self:custom.stage}
SECRET_KEY: ${env:SECRET_KEY}
events:
- http: ANY /
- http: 'ANY {proxy+}'
fetch_events:
handler: lambda_manage.handler
timeout: 60
environment:
SQLITE_BUCKET: ${self:custom.dbBucket}
SERVERLESS_STAGE: ${self:custom.stage}
SECRET_KEY: ${env:SECRET_KEY}
events:
- schedule:
rate: rate(12 hours)
input:
command: fetch_events