-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
73 lines (66 loc) · 1.57 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
service: slack-bot
provider:
name: aws
runtime: python3.7
stage: prod
region: ap-northeast-1
deploymentBucket: ${ssm:sls_deployment_bucket}
logRetentionInDays: 7
timeout: 60
memorySize: 128
environment:
TZ: Asia/Tokyo
SLACK_TOKEN: ${ssm:slack_bot_token}
SLACK_USER_TOKEN: ${ssm:slack_bot_user_token}
SLACK_CHANNEL: ${ssm:slack_bot_channel}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Scan
- dynamodb:BatchWriteItem
- dynamodb:DescribeTable
Resource: arn:aws:dynamodb:*:*:table/slack_emojies
functions:
postNewChannels:
handler: src/post_new_channels.lambda_handler
events:
- schedule:
rate: cron(0 0,3,6,9,12,15,18,21 * * ? *)
postNewEmojies:
handler: src/post_new_emojies.lambda_handler
events:
- schedule:
rate: cron(0 9 * * ? *)
postTodaysAdage:
handler: src/post_todays_adage.lambda_handler
events:
- schedule:
rate: cron(0 12 * * ? *)
package:
exclude:
- .mypy_cache/**
- .venv/**
- .vscode/**
- node_modules/**
plugins:
- serverless-python-requirements
- serverless-prune-plugin
custom:
pythonRequirements:
usePipenv: true
prune:
automatic: true
number: 3
resources:
Resources:
SlackEmojies:
Type: "AWS::DynamoDB::Table"
Properties:
TableName: slack_emojies
AttributeDefinitions:
- AttributeName: name
AttributeType: S
KeySchema:
- AttributeName: name
KeyType: HASH
BillingMode: PAY_PER_REQUEST