-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
97 lines (89 loc) · 2.58 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
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
service: CodeRecipeSample-YelpNoWaitUsingAWS
provider:
name: aws
runtime: python2.7
region: us-east-1
stage: ${opt:stage}
apiKeys:
- ${opt:stage}-scalableWaitlistWithAWS
usagePlan:
quota:
limit: 10000
offset: 0
period: DAY
throttle:
burstLimit: 1
rateLimit: 1
functions:
Notifier:
handler: src/handler.handle_notification
name: ${self:provider.stage}-Notifier
environment:
Stage: ${self:provider.stage}
twilio_account_sid: ${opt:twilio_account_sid}
twilio_auth_token: ${opt:twilio_auth_token}
twilio_from_number: ${opt:twilio_from_number}
CapacityMonitor:
handler: src/handler.handle_capacity_request
name: ${self:provider.stage}-CapacityMonitor
events:
- http:
path: post-capacity-request
method: POST
cors: true
integration: lambda
private: true
environment:
Stage: ${self:provider.stage}
QueueName: "#{LineupQueue.QueueName}"
QueueUrl: "#{LineupQueue}"
iamRoleStatementsName: ${self:provider.stage}-NewCustomerPutter-role
iamRoleStatements:
- Effect: "Allow"
Action:
- lambda:InvokeFunction
Resource: "arn:aws:lambda:${self:provider.region}:#{AWS::AccountId}:function:${self:provider.stage}-Notifier"
- Effect: "Allow"
Action:
- sqs:*
Resource: "#{LineupQueue.Arn}"
NextTableFetcher:
handler: src/handler.handle_fetch_next_customer
name: ${self:provider.stage}-NextTableFetcher
events:
- http:
path: get-next-customer
method: POST
cors: true
integration: lambda
private: true
environment:
Stage: ${self:provider.stage}
QueueName: "#{LineupQueue.QueueName}"
QueueUrl: "#{LineupQueue}"
iamRoleStatementsName: ${self:provider.stage}-NextTableFetcher-role
iamRoleStatements:
- Effect: "Allow"
Action:
- lambda:InvokeFunction
Resource: "arn:aws:lambda:${self:provider.region}:#{AWS::AccountId}:function:${self:provider.stage}-CapacityMonitor"
- Effect: "Allow"
Action:
- sqs:*
Resource: "#{LineupQueue.Arn}"
resources:
Resources:
LineupQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "${self:provider.stage}-LineupQueue.fifo"
FifoQueue: true
ContentBasedDeduplication: true
VisibilityTimeout: 3
plugins:
- serverless-python-requirements
- serverless-pseudo-parameters
- serverless-iam-roles-per-function
custom:
pythonRequirements:
dockerizePip: false