-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
84 lines (79 loc) · 2.08 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
80
81
82
83
84
service: dont-slack-evil
provider:
name: aws
runtime: go1.x
stage: dev
profile: dont-slack-evil-hackaton
environment:
DYNAMODB_TABLE_PREFIX: ${self:service}-${opt:stage, self:provider.stage}-
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:CreateTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE_PREFIX}*"
package:
exclude:
- ./**
include:
- ./bin/**
- ./data/**
custom:
secrets: ${file(secrets.${opt:stage, self:provider.stage}.yml)}
functions:
hello:
handler: bin/hello
events:
- http:
path: hello
method: get
environment:
PD_API_URL: ${self:custom.secrets.PD_API_URL}
PD_API_KEY: ${self:custom.secrets.PD_API_KEY}
messages:
handler: bin/messages
events:
- http:
path: messages
method: post
environment:
PD_API_URL: ${self:custom.secrets.PD_API_URL}
PD_API_KEY: ${self:custom.secrets.PD_API_KEY}
SLACK_VERIFICATION_TOKEN: ${self:custom.secrets.SLACK_VERIFICATION_TOKEN}
interactive:
handler: bin/interactive
events:
- http:
path: interactive
method: post
environment:
PD_API_URL: ${self:custom.secrets.PD_API_URL}
PD_API_KEY: ${self:custom.secrets.PD_API_KEY}
SLACK_VERIFICATION_TOKEN: ${self:custom.secrets.SLACK_VERIFICATION_TOKEN}
notifications:
handler: bin/notifications
events:
- http:
path: notifications
method: get
leaderboard:
handler: bin/leaderboard
events:
- http:
path: leaderboard
method: get
- schedule: rate(7 days)
redirectUrl:
handler: bin/redirectUrl
events:
- http:
path: redirect-url
method: get
environment:
CLIENT_ID: ${self:custom.secrets.CLIENT_ID}
CLIENT_SECRET: ${self:custom.secrets.CLIENT_SECRET}