Are Lambda Error Regex's in AWS API Gateway evaluated in the order they are listed (top to bottom)?
e.g., in the following example, is the 201 regex evaluated first, and if that doesn't match, then the 400 regex is evaluated, and if that doesn't match, then the 500 regex is evaluated?

The official answer is that the order of evaluation is undefined - I would advise against making any assumptions that the patterns will be evaluated in a specific order. You should aim to configure your API such that only a single response pattern will match a given integration response.
In practice, the evaluations will be evaluated in the order that they are defined. Again, you should assume that this could change at any time.
We do have a backlog item to allow explicit ordering of response evaluations.
Cheers, Ryan
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With