-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
61 lines (56 loc) · 1.23 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
service:
name: typescript-serverless-graphql
plugins:
- serverless-webpack
- serverless-dynamodb-local
- serverless-offline
provider:
name: aws
runtime: nodejs8.10
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
Fn::Join:
- ""
- - "arn:aws:dynamodb:*:*:table/"
- Ref: ProductsGqlDynamoDbTable
functions:
queryProducts:
handler: src/handler.graphql
events:
- http:
path: products
method: any
cors: true
environment:
TABLE_NAME: products-gql
resources:
Resources:
ProductsGqlDynamoDbTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: products-gql
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
custom:
dynamodb:
start:
migrate: true
stages:
- dev
- test