This project contains source code for a serverless application to create, and delete Amazon EventBridge one time schedules using Step Functions. Here, Step Function execution will wait until the schedule triggers as per the flexibleTimeWindow.
You may read more about this here: https://medium.com/@pubudusj/manage-eventbridge-schedules-using-step-functions-part-2-with-wait-state-9292ad21ec2e
Below are the deployment details. You need AWS CLI, SAM CLI and GIT installed in your machine.
- Clone the repository: https://github.com/pubudusj/manage-eb-schedules-with-stepfunctions-wait
- Go in to the directory
manage-eb-schedules-with-stepfunctions-wait
- Install dependencies with
sam build
- Deploy the stack with
sam deploy -g
- Once the stack is deployed successfully, you can start a Step Functions execution with below payload format. All fields are required.
{ "scheduleDate": "YYYY-MM-DD", "scheduleTime": "hh:mm:ss", "flexibleTimeWindow": 5 }
- This will create a EventBridge schedule and until the schedule triggers, the Step function execution will wait and then delete the schedule after the flexibleTimeWindow.
- To delete the stack, use:
sam delete