-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
64 lines (58 loc) · 1.64 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
service: big-mouth
plugins:
- serverless-pseudo-parameters
provider:
name: aws
runtime: nodejs12.x
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
functions:
get-index:
handler: functions/get-index.handler
events:
- http:
path: /
method: get
environment:
restaurant_api: https://i0pwlhy7kh.execute-api.us-east-1.amazonaws.com/dev/restaurants
cognito_user_pool_id: us-east-1_ggWMOrFE6
cognito_client_id: 4dlpfm8kfu9bac6gpjqvg87r4b
get-restaurants:
handler: functions/get-restaurants.handler
events:
- http:
path: /restaurants/
method: get
authorizer: aws_iam
environment:
restaurant_table: restaurants
search-restaurants:
handler: functions/search-restaurants.handler
events:
- http:
path: /restaurants/search
method: post
authorizer:
arn: arn:aws:cognito-idp:us-east-1:974936055901:userpool/us-east-1_ggWMOrFE6
environment:
restaurant_table: restaurants
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