Returning lambda's context.requestId in api gateway response body on timeout

Viewed 137

I need to return the lambda's context request Id back to the client when using an ApiGateway Lambda integration. I've tried this in ApiGateway -> Gateway Responses -> Integration Timeout -> Response Templates

{ "message":$context.error.messageString, "request_id": $context.awsEndpointRequestId, "request_id_2": $context.requestId }

However only $context.requestId shows in the response body, not $context.awsEndpointRequestId.

Is the awsEndpointRequestId ( which I assume is the lambda context request id ) not available if ApiGateway times out?

0 Answers
Related