title: Add Cognito Authorizer to Api Gateway LambdaRestAPI in CDK
body: <p>I am trying to add a Cognito Authorizer to an existing API Gateway <code>LambdaRestApi</code>. It is a full proxy integration, and I would like the Authorizer to apply by default to all methods. I can't see from the <a href="https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigateway.LambdaRestApi.html#addwbrrequestwbrvalidatorid-props" rel="nofollow noreferrer">docs</a> any indicator how to accomplish this via CDK.</p>
  <p>What I have:</p>
  <pre><code>const userPool = new cognito.UserPool(this, &quot;TestUsers&quot;, {
        userPoolName: &quot;This is a test&quot;
      });
  
  const proxyApi = new apig.LambdaRestApi(this, &quot;HelloFoodSecureProxyApi&quot;, {
        handler: proxyHandlerLambdaFunction
      });
  
  // proxyApi.addDefaultAuthorizor(userPool)
  </code></pre>
  <p>Best I can tell, I will have to revert to using a raw <code>RestApi</code>, add a <code>Resource</code> and <code>Method</code> that covers my entire API, and manually override the underlying CFN with something like <code>GET_resource.add_property_override(&quot;AuthorizerId&quot;, {&quot;Ref&quot;: authorizor.auth_id})</code></p>
  <p>Am I missing something? Any tips for this? Would rather not unspool my entire API (handily <code>proxy</code>d to in code) into infrastructure if I can help it.</p>