-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
79 lines (68 loc) · 1.85 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
service: appsync-graphql-nodejs-serverless
plugins:
- serverless-dynamodb-local
- serverless-appsync-plugin
- serverless-appsync-offline
- serverless-offline
- serverless-prune-plugin
provider:
name: aws
region: us-east-1
runtime: nodejs10.x
stage: ${opt:stage, 'local'}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
- lambda:*
- s3:*
Resource:
- arn:aws:dynamodb:${self:provider.region}:*:*
- arn:aws:lambda:${self:provider.region}:*:*
environment:
REGION: "${self:provider.region}"
STAGE: "${self:provider.stage}"
APPSYNC_NAME: "${self:custom.defaultPrefix}-appsync"
BOOK_TABLE_NAME: "${self:custom.defaultPrefix}-book"
PRUNE_VERSIONS_TO_KEEP: 3
custom:
dynamodb:
stages:
- local
start:
port: 8000
inMemory: false
dbPath: "dynamodb_local_data"
migrate: false
appSync: # appsync plugin configuration
name: "${self:provider.environment.APPSYNC_NAME}"
authenticationType: API_KEY
serviceRole: "AppSyncServiceRole"
dataSources: ${file(resources/data-sources.yml)}
mappingTemplates: ${file(resources/resolvers.yml)}
appsync-offline: # appsync-offline configuration
port: 62222
dynamodb:
client:
endpoint: "http://localhost:8000"
region: localhost
defaultPrefix: ${self:service}-${self:provider.stage}
prune:
automatic: true
includeLayers: true
number: ${self:provider.environment.PRUNE_VERSIONS_TO_KEEP}
layers:
vendor:
path: lambda-functions/layers/vendor
description: Third party libraries.
compatibleRuntimes:
- "${self:provider.runtime}"
allowedAccounts:
- '*'
functions:
- ${file(resources/lambda-functions.yml)}
resources:
# Roles
- ${file(resources/roles.yml)}
# DynamoDB tables
- ${file(resources/dynamodb-tables.yml)}