-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
97 lines (96 loc) · 2.75 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: ping-pong-graphql-api
provider:
name: aws
runtime: nodejs14.x
region: us-east-1
environment:
ITEM_TABLE: ping-pong-scores-dev # table name
RANK_TABLE: players-rank-dev
PLAYERS_TABLE: players-dev
iamRoleStatements:
- Effect: Allow # allow the Lambda to Get and Put Items of this table
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Scan
- dynamodb:UpdateItem
Resource: 'arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/ping-pong-scores-dev'
- Effect: Allow # allow the Lambda to Get and Put Items of this table
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Scan
- dynamodb:UpdateItem
Resource: 'arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/players-rank-dev'
- Effect: Allow # allow the Lambda to Get and Put Items of this table
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Scan
- dynamodb:UpdateItem
Resource: 'arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/players-dev'
resources:
Resources:
ItemsTable: # define the table
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
- AttributeName: itemId
AttributeType: S
KeySchema:
- AttributeName: itemId
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: 'ping-pong-scores-dev'
RanksTable: # define the table
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
- AttributeName: playerId
AttributeType: S
KeySchema:
- AttributeName: playerId
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: 'players-rank-dev'
PlayersTable: # define the table
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
- AttributeName: playerId
AttributeType: S
KeySchema:
- AttributeName: playerId
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: 'players-dev'
functions:
graphql:
handler: src/apollo-server.graphqlHandler
events:
- http:
path: graphql
method: post
cors: true
- http:
path: graphql
method: get
cors: true
plugins:
- serverless-webpack
- serverless-offline
- serverless-domain-manager
custom:
webpack:
includeModules: true
customDomain:
domainName: serverless.staara.ca
basePath: ''
stage: dev
createRoute53Record: true