-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
85 lines (80 loc) · 2.39 KB
/
Copy pathserverless.yml
File metadata and controls
85 lines (80 loc) · 2.39 KB
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
service: testing-serverless
plugins:
- serverless-pseudo-parameters
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: ap-southeast-2
iamRoleStatements:
- Effect: Allow
Action: dynamodb:scan
Resource: arn:aws:dynamodb:#{AWS::Region}:#{AWS::AccountId}:table/restaurants
- Effect: Allow
Action: execute-api:Invoke
Resource: arn:aws:execute-api:#{AWS::Region}:#{AWS::AccountId}:*/*/GET/restaurants
- Effect: Allow
Action: kinesis:PutRecord
Resource: arn:aws:kinesis:#{AWS::Region}:#{AWS::AccountId}:stream/order-events
functions:
get-index:
handler: functions/get-index.handler
events:
- http:
path: /
method: get
environment:
restaurants_api: https://rqpsqbjlw7.execute-api.ap-southeast-2.amazonaws.com/dev/restaurants
cognito_user_pool_id: ap-southeast-2_pxs41rjSB
cognito_client_id: 69o22b6dfgt2s2cpa1t0kbbgv
orders_api: https://rqpsqbjlw7.execute-api.ap-southeast-2.amazonaws.com/dev/orders
get-restaurants:
handler: functions/get-restaurants.handler
events:
- http:
path: /restaurants/
method: get
authorizer: aws_iam
environment:
restaurants_table: restaurants
defaultResults: 8
search-restaurants:
handler: functions/search-restaurants.handler
events:
- http:
path: /restaurants/search
method: post
authorizer:
arn: arn:aws:cognito-idp:#{AWS::Region}:#{AWS::AccountId}:userpool/ap-southeast-2_pxs41rjSB
environment:
restaurants_table: restaurants
place-order:
handler: functions/place-order.handler
events:
- http:
path: /orders
method: post
authorizer:
arn: arn:aws:cognito-idp:#{AWS::Region}:#{AWS::AccountId}:userpool/ap-southeast-2_pxs41rjSB
environment:
order_event_stream: order-events
resources:
Resources:
restaurantsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: restaurants
AttributeDefinitions:
- AttributeName: name
AttributeType: S
KeySchema:
- AttributeName: name
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
orderEventsStream:
Type: AWS::Kinesis::Stream
Properties:
Name: order-events
ShardCount: 1