AWS API Gateway: execution failed due to a configuration error: does not match output mapping and default output mapping is not configured

In the AWS API Gateway, I have a GET method that calls the lambda function.

When I test the method in the control panel of the API gateway, the lambda function succeeds, but the API gateway does not map the context.success () call to the result of 200, even though the default value is set to yes.

Instead, I get this error:

Execution failed due to configuration error: No match for output mapping and no default output mapping configured 

This is my integration setup: enter image description here

And this is my method response setup: enter image description here

Basically, I would expect the Gateway API to recognize successful lambda execution and then match it by default with a 200 response, but that doesn't happen.

Does anyone know why this is not working?

+8
amazon-web-services aws-lambda aws-api-gateway aws-sdk
source share
3 answers

There was a problem saving the default integration response mapping that was resolved. The error triggered API method requests that were not saved correctly to return a 500 error; CloudWatch logs should contain:

 Execution failed due to configuration error: No match for output mapping and no default output mapping configured. 

Since "ENABLE CORS" saves the default integration response, this problem also appeared in your script.

For more information, see the AWS forum entry: https://forums.aws.amazon.com/thread.jspa?threadID=221197&tstart=0

Best

Jurgen

+4
source share

What worked for me:
1. Manually created OPTIONS method in Api Gateway Console
2. In the "Response Method" section of the created OPTIONS method, 200 OK is added
3. Selected method option and enabled CORS from the menu

+2
source share

I found the problem:

Amazon has added a new button in the API Gateway resource setting called Enable CORS. I previously clicked on this button, but once turned it on it seems there is no way to turn it off

Enabling CORS with this button (instead of doing it manually, which I did) seems to cause an internal server error even for successful lambda execution.

enter image description here

SOLUTION: I deleted the resource and created it again without clicking on โ€œEnable CORSโ€ this time, and everything works fine.

This seems to be a bug with this function, but maybe I just don't understand it well. Please comment if you have additional information. Thank you

+1
source share

All Articles