title: Define lambda authorizer response format using serverless framework
body: <p>According <a href="https://aws.amazon.com/blogs/compute/introducing-iam-and-lambda-authorizers-for-amazon-api-gateway-http-apis/" rel="nofollow noreferrer">to this AWS documentation page</a> covering authorizers for AWS API Gateway it is possible to define authorizer as lambda function returning a boolean value in <code>isAuthorized</code> response field to allow/deny the API request.</p>
  <p>However after numerous attempts I can't understand how to define it in <code>serverless.yml</code> (or at least in AWS console)</p>
  <p>I'm new to AWS and serverless framework. I've decided not to dive into <code>IAM</code> access policies or <code>Cognito</code> just yet, thus I'm trying to build a very simple lambda authorizer function that just yields a boolean value to allow/deny API access.</p>
  <p>I have defined my <code>functions</code> section in <code>serverless.yml</code> as follows:</p>
  <pre><code>functions:
    add_content:
      handler: src.handler.add
      module: src/handler
      events:
        - http:
            path: /content
            method: post
            authorizer: customAuthorizer
    customAuthorizer:
      handler: src.authorizer.authorize
      module: src/authorizer
  </code></pre>
  <p>The authorizer function is as simple as:</p>
  <pre><code>def authorize(event, context):
      response = {&quot;isAuthorized&quot;: True}
      return response
  </code></pre>
  <p>However if I try to test it I see the following <code>CloudWatch</code> stacktrace:</p>
  <pre><code>Mon May 03 20:06:11 UTC 2021 : Endpoint request body after transformations: {&quot;type&quot;:&quot;TOKEN&quot;,&quot;methodArn&quot;:&quot;arn:aws:execute-api:eu-central-1:238758647165:ww9wzq8hp8/ESTestInvoke-stage/GET/&quot;,&quot;authorizationToken&quot;:&quot;123456789&quot;}
  Mon May 03 20:06:11 UTC 2021 : Sending request to https://lambda.eu-central-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:eu-central-1:238758647165:function:sls-playground-dev-customAuthorizer/invocations
  Mon May 03 20:06:11 UTC 2021 : Authorizer result body before parsing: {&quot;isAuthorized&quot;: true}
  Mon May 03 20:06:11 UTC 2021 : Execution failed due to configuration error: Invalid JSON in response: Unrecognized field &quot;isAuthorized&quot; , not marked as ignorable
  Mon May 03 20:06:11 UTC 2021 : AuthorizerConfigurationException
  </code></pre>
  <p>In addition to that:</p>
  <ol>
  <li>When opening API gateway in AWS console I don't have the <code>Develop</code> section as shown in documentation.</li>
  <li>If I try to create an auhtorizer manually from AWS console there's no <code>response mode</code> section.</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/iYwhF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iYwhF.png" alt="enter image description here" /></a></p>