skip to Main Content

When using AWS EventBridge an event can directly trigger sending an HTTP request (to some external webhook) by using e.g. API Destinations. Is it also similarly possible for a Lambda to delegate another AWS service to send a HTTP request?

Using EventBridge with API Destinations, directly, limits the opportunity to augment the request (with any data beyond what was exposed through the original event message). But on the other hand, this has the advantage that it manages performing retries (if the HTTP request initially fails due to some connectivity disruption or temporary downtime). Whereas if the a Lambda tries to make the HTTP request, then the Lambda code must assume responsibility for retries (and it also incurs extra charges while idling between retries). Is there a straightforward way to interpose arbitrary code (such as a Lambda) into an event processing pipeline while still ultimately delegating AWS to manage dispatching a HTTP request to an external web service?

2

Answers


  1. this can be achieved by putting in place multiple event rules. Your lambda function, once triggered by your original rule can re-publish the augmented event back to event bridge, which would get picked up by the second event rule and forward to your http endpoint of choice.

    Login or Signup to reply.
  2. You seem to be concerned with retries on failure, and thinking that you have to have Lambda delegate the request to another service in order to have AWS manage the retries for you, but that’s not true.

    Instead, if you just added your request to an SQS queue that triggers a Lambda function, you could have the queue configured to trigger Lambda multiple times until Lambda succeeds.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search