Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the order of evaluation of AWS API Gateway Lambda Error Regex's?

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?

enter image description here

like image 608
Rob Bednark Avatar asked Nov 16 '25 12:11

Rob Bednark


1 Answers

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

like image 145
RyanG Avatar answered Nov 18 '25 11:11

RyanG



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!