-
Notifications
You must be signed in to change notification settings - Fork 6
/
serverless.yml
42 lines (36 loc) · 1.16 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
service: serverless-jwt-auth
frameworkVersion: ">=1.1.0 <2.0.0"
plugins:
- serverless-dynamodb-local
- serverless-offline
custom:
env: ${file(env.${opt:STAGE, 'prod'}.yml), file(env.yml)}
dynamodb: ${file(config/dynamodb-offline.yml)}
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:STAGE, self:custom.env.STAGE}
region: ${self:custom.env.REGION}
environment:
JWT_SECRET: ${self:custom.env.JWT_SECRET}
TABLENAME_USERS: ${self:service}-${self:provider.stage}-users
TABLENAME_TASKS: ${self:service}-${self:provider.stage}-tasks
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
# DynamoDB tables to provide access to
- "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.TABLENAME_USERS}"
- "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.TABLENAME_TASKS}"
functions:
- ${file(routes/users.yml)}
- ${file(routes/tasks.yml)}
resources:
Resources:
- ${file(config/dynamodb.yml)}