I have an API Gateway in front of a Lambda that has reserved concurrency. When the Lambda returns a 429 for throttling, I'd like to reply to the API client with a 429 Method Response. I have other Integration Responses working for other Method Responses, based on the Lambda's response body. However, I can't get the integration response to process the response body like it does with other responses; perhaps because those responses are http 200's, and this is a non-200?
Wed Jun 08 20:17:53 UTC 2022 : Endpoint response body before transformations:{"Reason":"ReservedFunctionConcurrentInvocationLimitExceeded","Type":"User","message":"Rate Exceeded."} Wed Jun 08 20:17:53 UTC 2022 : Lambda invocation failed with status: 429. Lambda request id: 00000000-e2b9-4000-9f00-700000007a
(I'd expect the mapping template to be able to parse the above json in the "Endpoint response body before transformations" message, like the other responses being handled, but nope...)
Wed Jun 08 20:17:53 UTC 2022 : Execution failed due to configuration error: Rate Exceeded.
Wed Jun 08 20:17:53 UTC 2022 : Method completed with status: 500
How can I parse the response body of a non-200 response?
I get the same experience whether trying to pass through, or trying to use a mapping templage.