Thanks for your question!
- Unfortunately the time field in PutEventsRequestEntry is not used for event scheduling, and does not affect when the event will be delivered to either the event bus, or the Target of any Rule you have created on that event bus. It is there, as part of a standardized set of metadata for event producers to use to describe events.
The delay feature is an interesting one. Could you tell us more about your use case to help us understand how we can best consider addressing it in our roadmap?
In general, if you are interested in scheduling messages in the future, one way to do that in AWS is to use the Scheduled Events: https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html
Using this feature, you can configure a Lambda function to be executed in the future, or on a recurring schedule. That Lambda function could in turn put messages on an SQS queue or PutEvents onto an Amazon EventBridge event bus.
- Currently, there is no way to manage events that have been submitted using PutEvents. However, as events are only processed if a Rule is created for the event bus, with a target, one option available for "cancelling" events is to temporarily disable the rule handling them. But I don't think that's what you had in mind, given that the context of the question was about scheduling events in the future.
Hey, thanks for your reply! :)
My use case is essentially for scheduling API calls against our app that admins would otherwise have to make manually. We run surveys, so when a survey is created we can schedule the API calls to launch/close/publish etc. - these events are generally a few days from when we're scheduling them.
Currently we use Azure's service bus, which lets us (using their AMQP API) submit a task with an arbitrary timestamp at which it'll appear. This API returns a cancellation token that we can save in our database and use to cancel the task so it won't run, if we need to. In the same way as AWS SQS -> Lambda triggers, their service bus can trigger their equivalent of a Lambda, which can then make the appropriate API request described by the queued task.
In an ideal world we'd bring this into AWS, but I'm not aware of any service in AWS that can schedule a Lambda to run with the given data at an arbitrary future time, and in such a way that we can cancel it any time before then. Could CloudWatch events that you linked to be used for this purpose?
Answering my own question here, this can be done using AWS step functions - as long as the task is to run within the next year. We can use a 'delay until timestamp' step and then have the Lambda called (eg. by API or SQS) in the step after that.
Is the pricing of using services in outpost the same as using on cloud?Accepted Answerasked a year ago
How reliable is the time field in the FlexMatch event notification messages?Accepted Answerasked 3 years ago
Why can't you create a scheduled rule on a custom bus in EventBridge?asked 2 months ago
ECS Capacity Provider Scale In Timeasked 3 months ago
How to reduce the time it takes a request to pass from a ALB to the actual Fargate Server?asked 6 months ago
Using the 'time' field in PutEventsRequestEntry to schedule eventsasked 3 years ago
how to schedule the managed image updates in appstreamasked 7 months ago
AWS Location Tracker - custom event-bus settingasked 5 months ago
Is there an Amazon service to schedule future actions?asked 8 months ago
FSX custom backup cloud formation template Failing to create stackasked 4 years ago