-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
59 lines (51 loc) · 1.37 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
ScheduleTableName:
Type: String
Description: Name of the dynamodb table to be created & used by function
Default: citium_schedule
Globals:
Function:
Runtime: go1.x
Timeout: 3
MemorySize: 128
Environment:
Variables:
TABLE_NAME: !Ref ScheduleTableName
BASE_URL: ""
API_TOKEN: ""
USER_AGENT: citium/0.0.1
Resources:
TriggerAPIFunction:
Type: AWS::Serverless::Function
Properties:
Handler: citium
Events:
PeriodicCheck:
Type: Schedule
Properties:
Schedule: rate(5 minutes)
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref ScheduleTableName
ScheduleTable:
Type: AWS::Serverless::SimpleTable
Properties:
TableName: !Ref ScheduleTableName
PrimaryKey:
Name: ID
Type: String
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
Outputs:
TriggerAPIFunction:
Description: "TriggerAPIFunction ARN"
Value: !GetAtt TriggerAPIFunction.Arn
TriggerAPIFunctionIamRole:
Description: "Implicit IAM Role created for TriggerAPIFunction"
Value: !GetAtt TriggerAPIFunctionRole.Arn
ScheduleTable:
Description: "ScheduleTable ARN"
Value: !GetAtt TriggerAPIFunction.Arn