title: Mapping Lambda output in API Gateway gives server error
body: <p>I have an AWS API Gateway setup, served by a Python Lambda function. For successful responses the Lambda returns a response of the form:</p>
  
  <pre><code>"200:{\"somekey\": \"somevalue\"}"
  </code></pre>
  
  <p>By default, the <em>Integration Response</em> settings in the gateway console have just one rule configured with a <em>Lambda Error Regex</em> of <em>.*</em> mapping to a response status of 200. This works fine.</p>
  
  <p>The problem is when I try to change that to <em>200.*</em> (with a view to enabling more specific codes going forward). Now I get a</p>
  
  <pre><code>{"message": "Internal server error"}
  </code></pre>
  
  <p>every time I hit the gateway with <strong>any</strong> request (resulting in a 200 or not).</p>
  
  <p>No error logs are written to CloudWatch.</p>
  
  <p><a href="https://i.stack.imgur.com/NSXKW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NSXKW.png" alt="enter image description here"></a></p>
  
  <p>I want to know how I can map Lambda outputs to HTTP status codes successfully in AWS API Gateway.</p>