2

I'm trying to call a public API endpoint daily on a schedule from AWS. So how I would do this back in the day on a plain old server would be:

cron(0 0 * * ? *)   curl someurl.com/endpoint

In my crontab. How is the best way to go about this in the new serverless world on AWS? I've looked at Eventbridge but I can't see what kind of event target I need. Should I write a lambda that calls the endpoint? That seems like overkill.

Leon Aves
  • 739
  • 1
  • 7
  • 24

2 Answers2

2

Eventbridge supports API destinations. With this option EventBridge invokes the HTTP endpoint and delivers the event as a payload within the request. You can use any preferred HTTP method, such as GET or POST.

Of course, you can configure the pattern as a crontab.

On Eventbridge console select Target as "API destination":

enter image description here


Reference:

https://aws.amazon.com/blogs/compute/using-api-destinations-with-amazon-eventbridge/

OARP
  • 3,429
  • 1
  • 11
  • 20
1

SNS as the target for Eventbridge may be what you're looking for.

SNS topics can have HTTP & HTTPS endpoints as subscribers so this could solve your problem without the need for a Lambda function.

Craig S
  • 106
  • 1
  • 5