내용으로 건너뛰기

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

질문됨 2년 전858회 조회
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.

전문가
답변함 2년 전
전문가
검토됨 2년 전
AWS
전문가
검토됨 2년 전
  • 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

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠