-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
75 lines (67 loc) · 1.8 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
# NOTE: update this with your service name
service: lunar-tour-api
# Use the serverless-webpack plugin to transpile ES6
plugins:
- serverless-bundle
- serverless-offline
- serverless-dotenv-plugin
# serverless-webpack configuration
# Enable auto-packing of external modules
custom:
stage: ${opt:stage, self:provider.stage}
region: ${opt:region, self:provider.region}
ListingsDB: ${self:custom.stage}-lunar-listings
BookingsDB: ${self:custom.stage}-lunar-bookings
tableThroughputs:
prod: 1
default: 1
tableThroughput: ${self:custom.tableThroughputs.${self:custom.stage}, self:custom.tableThroughputs.default}
serverless-offline:
port: 4000
bundle:
linting: false
provider:
name: aws
runtime: nodejs12.x
stage: dev
region: us-east-1
environment:
BookingsDB: ${self:custom.BookingsDB}
ListingsDB: ${self:custom.ListingsDB}
stripeSecretKey: ${env:STRIPE_SECRET_KEY}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:GetRecords
- dynamodb:GetShardIterator
- dynamodb:DescribeStream
- dynamodb:ListStream
Resource:
- "Fn::GetAtt": [ListingsDB, Arn]
- "Fn::GetAtt": [BookingsDB, Arn]
functions:
graphql:
handler: src/graphql.graphqlHandler
environment:
SLS_DEBUG: true
events:
- http:
path: graphql
method: post
cors: true
integration: lambda-proxy
- http:
path: graphql
method: get
cors: true
integration: lambda-proxy
resources:
- ${file(resources/listing-db.yml)}
- ${file(resources/booking-db.yml)}