-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
64 lines (60 loc) · 1.61 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
service: forex
#frameworkVersion: ">=1.9.0"
custom:
namespace: ${self:service}-${self:custom.stage}
stage: ${opt:stage, self:provider.stage}
provider:
name: aws
runtime: nodejs4.3
stage: dev
region: us-west-2
environment:
CLIENT_ID: '<YOUR_SLACK_CLIENT_ID>'
CLIENT_SECRET: '<YOUR_SLACK_CLIENT_SECRET>'
VERIFICATION_TOKEN: '<YOUR_SLACK_VERIFICATION_TOKEN>'
INSTALL_ERROR_URL: '<YOUR_SLACK_INSTALL_ERROR_URL>'
INSTALL_SUCCESS_URL: '<YOUR_SLACK_INSTALL_SUCCESS_URL>'
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
install:
handler: install.handler
events:
- http:
path: install
method: get
events:
handler: events.handler
events:
- http:
path: events
method: post
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