Accessing responses from EventBridge API Destination calls

0

When an event payload is routed to an EventBridge API Destination target API how does one access responses returned from the target API?

EventBridge API Destination provides the means to make GET requests to an external API. By definition a response is expected. How does one access the response payload or even the HTTP response code?

I have successfully implemented and tested each of the HTTP verbs available in EventBridge API Destinations. I am able to verify the state of the data in the target API is successfully changed when PUT, POST, & DELETE requests are routed through the API Destination.

However, neither the response body nor the response code returned from the target API appear to be accessible or available for further processing. How does one access the response body and/or the response code returned by the target API successful invocation of an API Destination request?

Thanks

已提問 9 個月前檢視次數 495 次
1 個回答
1
已接受的答案

Hello.

As far as I know, it is not possible to check the response when executing external APIs using EventBridge API Destinations.
If you have a requirement to check and process the response from executing an API, I think you need to use Lambda as the EventBridge target.
If you use Lambda, it should be possible to execute the API and get the response.

profile picture
專家
已回答 9 個月前
profile picture
專家
已審閱 9 個月前
profile pictureAWS
專家
已審閱 9 個月前
  • Correct. API Endpoints are for notification (as with any other target). EventBridge doesn't care what the response is. It only cares if there is an error response or no response within 5 seconds, so it knows it needs to retry.

  • Thank you for the quick response, Riki & Uri.

    Your responses confirm my current solution. I was hoping EventBridge API Destinations had gained this functionality over time since the last time I checked.

    The few lambda I have remaining are largely those needed to make calls to external API's and forward the responses back to EventBridge or return them to next step in a state machine for further processing.

    Without the response body or even the response|status code this severely limits the utility EventBridge API Destinations offer.

    So, I will accept these as the answer.

    Respect,

    Rod

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南