1

I have a serverless infrastructure that has a front-end web app. In this front-end, users can select specific times of day for taskX to occur.

I know (and have) set up events to occur on a recurring schedule with a manually-created (with serverless framework) cron-based trigger. It's my understanding I could use a cron to trigger at specific times as explained here: How to trigger a Lambda function at specific time in AWS? and here: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-run-lambda-schedule.html ...

...however, I don't know how I would programmatically create (and also remove) these events using the AWS SDK. (also noting I might have thousands of said events - Perhaps eventbridge isn't the right tool?)

Suggestions on how to do this?

lowcrawler
  • 6,777
  • 9
  • 37
  • 79
  • 1
    https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutRule.html – luk2302 Mar 22 '22 at 15:04
  • ugh... I searched for that for quite a while. No idea why I couldn't find it! Thanks! – lowcrawler Mar 22 '22 at 15:08
  • 3
    ALso - what language are you using. For example, if you want to use AWS SDK for Java, see https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/eventbridge – smac2020 Mar 22 '22 at 15:09

1 Answers1

0

As I understood your question correctly, you need to set up a one-time schedule. Recently(10-Nov-2022) AWS launched a new service called EventBridge Scheduler and it supports a One-time schedule. I already added an answer here, please have a look. If not comment below, I might think I can help you.

Kushan Gunasekera
  • 7,268
  • 6
  • 44
  • 58