/
template.yaml
121 lines (117 loc) · 2.86 KB
/
template.yaml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
cab-app
Checkmate accountability bot SAM
Parameters:
AwsRegion:
Type: String
Description: Aws service region
Default: local
SlackBotToken:
Type: String
Description: Slack bot token
Default: token
Globals:
Function:
Timeout: 20
MemorySize: 128
Environment:
Variables:
AwsRegion: !Ref AwsRegion
SlackBotToken: !Ref SlackBotToken
Resources:
EventGatewayFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: makefile
Properties:
FunctionName: checkmate-EventGatewayFunction
CodeUri: .
Handler: event-gateway
Runtime: go1.x
Architectures:
- x86_64
Events:
CatchAll:
Type: Api
Properties:
Path: /events
Method: POST
EventTaskFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: makefile
Properties:
FunctionName: checkmate-EventTaskFunction
CodeUri: .
Handler: event-task
Runtime: go1.x
Architectures:
- x86_64
InteractionGatewayFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: makefile
Properties:
FunctionName: checkmate-InteractionGatewayFunction
CodeUri: .
Handler: interaction-gateway
Runtime: go1.x
Architectures:
- x86_64
Events:
CatchAll:
Type: Api
Properties:
Path: /interactions
Method: POST
InteractionTaskFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: makefile
Properties:
FunctionName: checkmate-InteractionTaskFunction
CodeUri: .
Handler: interaction-task
Runtime: go1.x
Architectures:
- x86_64
ShufflerFunction:
Type: 'AWS::Serverless::Function'
Metadata:
BuildMethod: makefile
Properties:
FunctionName: checkmate-ShufflerFunction
CodeUri: .
Handler: shuffler
Runtime: go1.x
Events:
CWSchedule:
Type: Schedule
Properties:
Schedule: 'cron(0 6 ? * SUN/2 *)'
Name: AccountabilityShuffleSchedule
Description: cron to run the shuffler function weekly
UsersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: checkmateafrica-users
AttributeDefinitions:
- AttributeName: Email
AttributeType: S
KeySchema:
- AttributeName: Email
KeyType: HASH
BillingMode: PAY_PER_REQUEST
PairsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: checkmateafrica-pairs
AttributeDefinitions:
- AttributeName: Email
AttributeType: S
KeySchema:
- AttributeName: Email
KeyType: HASH
BillingMode: PAY_PER_REQUEST