-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
65 lines (60 loc) · 1.7 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
service: forex-practice
frameworkVersion: "<=1.25.0"
custom:
namespace: ${self:service}-${self:custom.stage}
stage: ${opt:stage, self:provider.stage}
provider:
name: aws
runtime: nodejs4.3
stage: dev
region: ap-southeast-1
environment:
CLIENT_ID: '305703264613.309344447746'
CLIENT_SECRET: 67fa87052d7c6170a5926e6f0decff87
VERIFICATION_TOKEN: hL6XbqVqCBWp7q8HklkS7P29
INSTALL_ERROR_URL: http://forex-mtgangceen.s3-website-ap-southeast-1.amazonaws.com/error.html
INSTALL_SUCCESS_URL: http://forex-mtgangceen.s3-website-ap-southeast-1.amazonaws.com/index.html
NAMESPACE: ${self:custom.namespace}
TEAMS_TABLE: ${self:custom.namespace}-teams
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
Resource:
- arn:aws:dynamodb:*:*:table/${self:provider.environment.TEAMS_TABLE}
- Effect: Allow
Action:
- lambda:invokeFunction
Resource:
- arn:aws:lambda:*:*:function:${self:custom.namespace}-actions
functions:
actions:
handler: actions.handler
events:
handler: events.handler
events:
- http:
path: events
method: post
install:
handler: install.handler
events:
- http:
path: install
method: get
resources:
Resources:
TeamsDynamoDbTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:provider.environment.TEAMS_TABLE}
AttributeDefinitions:
- AttributeName: team_id
AttributeType: S
KeySchema:
- AttributeName: team_id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5