CDK construct for serverless scheduling
cdk-scheduler, a CDK construct to schedule events precisely and serverless
This construct enables to trigger an event at a given time on a serverless architecture.
You should use
cdk-scheduler if you need to trigger an event at a precise time (down to the second) on your AWS application. If you want to compare options, check out our article on different serverless scheduling solutions.
Understand how the Scheduler works
cdk-scheduler is powered by SQS feature to delay events up to 15 minutes.
A lambda is scheduled to query a DynamoDB Table every 15 minutes, it pushes every events scheduled in the next 15 minutes to SQS with a delay corresponding the desired publication date.
Overview of the architecture
Usage examples with CDK - Typescript
If you want to implement serverless scheduling you can get inspirations from cdk-scheduler full implementations :
For cdk-scheduler to function properly the elements added to DynamoDB must have the following attributes:
||string||The primary key is always the same. Its value is the attribute
||string||The secondary key should start with the timestamp at which you wish to publish the event. You can concatenate with a unique id to be sure you do not have duplicates if you separate them with a
||map||This is an object, without format contraints. This payload will be sent in the event once it's published. Use this to detail the action you want to execute a the scheduled time|
If you wish to contribute to cdk-scheduler: