-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
93 lines (88 loc) · 2.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
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
85
86
87
88
89
90
91
92
93
service: poor-webook
provider:
name: aws
runtime: python3.6
memorySize: 128
environment:
CLIENT_ID: ${file(local.yml):slack.clientId}
CLIENT_SECRET: ${file(local.yml):slack.clientSecret}
VERIFICATION_TOKEN: ${file(local.yml):slack.verificationToken}
package:
exclude:
- test.py
functions:
hears:
handler: handler.hears
events:
- http:
path: listening
method: get
- http:
path: listening
method: post
install:
handler: handler.install
events:
- http:
path: install
method: get
thanks:
handler: handler.thanks
events:
- http:
path: thanks
method: get
github:
handler: handler.github_webhook
events:
- http:
path: github
method: post
- http:
path: github
method: get
resources:
Resources:
DynamoDbTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: poor-webhook-tokens
AttributeDefinitions:
- AttributeName: account_id
AttributeType: S
KeySchema:
- AttributeName: account_id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
DynamoDbTable1:
Type: AWS::DynamoDB::Table
Properties:
TableName: poor-webhook-events
AttributeDefinitions:
- AttributeName: X-Github-Delivery
AttributeType: S
KeySchema:
- AttributeName: X-Github-Delivery
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
DynamoDBIamPolicy:
Type: AWS::IAM::Policy
DependsOn: DynamoDbTable
Properties:
PolicyName: lambda-poor-webhook-dynamodb
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
Resource: arn:aws:dynamodb:*:*:table/poor-webhook-*
Roles:
- Ref: IamRoleLambdaExecution
plugins:
- serverless-python-requirements