-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
104 lines (99 loc) · 2.56 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
98
99
100
101
102
103
104
service: taplist-backend
provider:
name: aws
runtime: nodejs8.10
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:BatchGetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:GetRecords
- dynamodb:GetShardIterator
- dynamodb:DescribeStream
- dynamodb:ListStreams
Resource: arn:aws:dynamodb:us-east-1:*:*
functions:
playground:
handler: handler.graphql
events:
- http:
path: playground
method: get
cors: true
graphql:
handler: handler.graphql
events:
- http:
path: graphql
method: post
cors: true
environment:
TWILLIO_ACCOUNT_SID: ${file(./serverless.env.yml):dev.TWILLIO_ACCOUNT_SID}
TWILIO_AUTH_TOKEN: ${file(./serverless.env.yml):dev.TWILIO_AUTH_TOKEN}
resources:
Resources:
BreweriesDynamoDbTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: taplist_app_breweries
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
BeersDynamoDbTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: taplist_app_beers
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
UsersDynamoDbTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: taplist_app_users
AttributeDefinitions:
- AttributeName: phone
AttributeType: S
KeySchema:
- AttributeName: phone
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
plugins:
- serverless-dynamodb-local
- serverless-offline
custom:
dynamodb:
start:
port: 8000
inMemory: true
migrate: true
seed: true
seed:
domain:
sources:
- table: taplist_app_breweries
sources: [./seed_data/brewery_data.json]
- table: taplist_app_beers
sources: [./seed_data/beer_data.json]