This repository has been archived by the owner on Mar 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
88 lines (77 loc) · 2.06 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
# For full config options, check the docs:
# docs.serverless.com
service: reminderbot
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"
provider:
name: aws
runtime: go1.x
timeout: 30
versionFunctions: false
memorySize: 128
# you can overwrite defaults here
# stage: dev
# region: us-east-1
# you can add statements to the Lambda function's IAM Role here
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:DeleteItem"
- "dynamodb:GetItem"
- "dynamodb:PutItem"
- "dynamodb:Query"
- "dynamodb:Scan"
- "dynamodb:UpdateItem"
Resource:
- Fn::GetAtt:
- queueTable
- Arn
# you can define service wide environment variables here
environment:
stage: ${self:custom.stage}
namespace: ${self:custom.namespace}
reminderbot_queue: ${self:custom.tableName}
SLACK_APP_ID: ${env:SLACK_APP_ID}
SLACK_CLIENT_ID: ${env:SLACK_CLIENT_ID}
SLACK_CLIENT_SECRET: ${env:SLACK_CLIENT_SECRET}
SLACK_SIGNING_SECRET: ${env:SLACK_SIGNING_SECRET}
SLACK_VERIFICATION_TOKEN: ${env:SLACK_VERIFICATION_TOKEN}
NEXMO_API_KEY: ${env:NEXMO_API_KEY}
NEXMO_API_SECRET: ${env:NEXMO_API_SECRET}
NEXMO_API_FROM: ${env:NEXMO_API_FROM}
custom:
stage: ${opt:stage, self:provider.stage}
namespace: ${self:service}_${self:custom.stage}
tableName: ${self:custom.namespace}_reminderbot_queue
package:
exclude:
- ./**
include:
- ./bin/**
functions:
cron:
handler: bin/cron
events:
- schedule: cron(* * * * ? *) # every minute
sms:
handler: bin/sms
events:
- http:
path: sms
method: POST
resources:
Resources:
queueTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: '${self:custom.tableName}'
AttributeDefinitions:
- AttributeName: ID
AttributeType: S
KeySchema:
- AttributeName: ID
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1