-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
96 lines (86 loc) · 2.12 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
94
95
96
service:
name: security-bot
# Add the serverless-webpack plugin
plugins:
- serverless-webpack
provider:
name: aws
region: ap-northeast-1
runtime: nodejs8.10
environment:
CHATWORK_CHATROOM_ID: ${ssm:chatworkChatroomId}
CHATWORK_API_TOKEN: ${ssm:chatworkApiToken}
CHATWORK_WEBHOOK_TOKEN: ${ssm:chatworkWebhookToken}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:DeleteItem
- sns:CreateTopic
- sns:Publish
Resource: '*'
functions:
checkMessage:
handler: handler.checkMessage
memorySize: 128
description: トークン・メッセージの確認
events:
- http:
method: post
path: check-message
sendMessage:
handler: handler.sendMessage
memorySize: 128
description: チャットワークメッセージ通信
events:
- sns: sendMessage
addWord:
handler: handler.addWord
memorysize: 128
description: 対象言葉の追加
events:
- sns: addWord
removeWord:
handler: handler.removeWord
memorysize: 128
description: 対象言葉の削除
events:
- sns: removeWord
getWords:
handler: handler.getWords
memorySize: 128
description: 対象言葉の一覧
events:
- sns: getWords
checkRSS:
handler: handler.checkRSS
memorySize: 128
description: RSSフィードのチェック
# events:
# - schedule: cron(0 1 * * MON-FRI *) # UTC01:00 (JSTが+9時間), 月〜金
help:
handler: handler.help
memorySize: 128
description: 使い方のメッセージ通信
events:
- sns: help
resources:
Resources:
SecurityBotDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: 'name'
AttributeType: 'S'
KeySchema:
-
AttributeName: 'name'
KeyType: 'HASH'
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: 'words'