| string:Hash | string | string | string | string | string | string | |------|---|---|---|---|---|---|---| | Id | StartTime | EndTime | Recurrence | Type | Name | Message |
- Creates DynamoDB table:
scheduler_table
- Creates Lambda function to act as Cloudformation custom resource
- Adds an ECS container instance that polls
scheduler_table
to a cluster
- The polling container is started with a polling option that defines the polling interval of DynamoDB, like
--interval 60
. - Upon polling, all tasks are retrieved and their periodicity examined.
- If a task is ready to be triggered, the
message
is sent to the SQSqueue
.
- If a task will be triggered before the next polling interval occurs, the main thread is forked and at the correct time, the task is triggered and the fork merged.
{
"Resources" : {
...
"Task": {
"Type": "Custom::Tasker",
"Properties": {
"ServiceToken": { "Ref" : "TaskerArn" },
"Definitions" : [
{
"Id" : "EMEARegionHarvest",
"Type" : "SQS",
"Name" : { "Fn::GetAtt" : ["TaskQueue", "QueueName"] },
"Recurrence" : "30 */6 * * *",
"Message" : {
"$" : ["rake harvest[emea]"]
}
},
{
"Id" : "ScheduledServiceScaler",
"Type" : "SNS",
"Name" : { "Fn::GetAtt" : ["ScalerTopic", "TopicName"] },
"StartTime" : "2015-10-01T00:00:00Z",
"EndTime" : "2015-10-02T00:00:00Z",
"Recurrence" : "*/10 * * * *",
"Message" : {
...
}
}
]
}
},
"ScalerTopic" : {
"Type" : "AWS::SNS::Topic"
},
"TaskQueue" : {
"Type" : "AWS::SQS::Queue"
},
...
}
}