title: Lambda Integration vs. Lambda Proxy: Pros and Cons
body: <p>What do you think are the Pros and Cons of using Lambda integration with and without the proxy feature in AWS API Gateway (and more specifically, when using the Serverless framework)? Here's what I think up to now:</p>
  
  <p><strong>Lambda Integration with Proxy</strong></p>
  
  <ul>
  <li><strong>Pro</strong>: One can rapidly prototype and code without worrying about all the needed configuration details (and reinventing a few wheels like generic template mappings, etc).</li>
  <li><strong>Pro</strong>: It's really easy to return any status code and custom headers, while at the same time there's a generic way to read the body, headers, parameters, of the request.</li>
  <li><strong>Con</strong>: Everything is done in code, so autogenerating documentation is a bit more difficult. Dependencies (headers, models, returned status codes) are "hidden" in the code.</li>
  </ul>
  
  <p><strong>Lambda Integration without Proxy</strong></p>
  
  <ul>
  <li><strong>Con</strong>: Involves <em>a lot</em> more of work to set it up, and this configuration might be duplicated in different resources.</li>
  <li><strong>Pro</strong>: It allows one to decouple what the lambda receives and returns, and how it gets mapped to different HTTP status codes, headers, and payloads.</li>
  <li><strong>Pro</strong>: Very useful because it stipulates upfront what it returns, and what it requires in terms of headers and payloads.</li>
  <li><strong>Pro</strong>: The hard work when setting up everything is useful in the long run because one can export everything to Swagger, so others can use this to generate different SDKs for it.</li>
  </ul>
  
  <p>What are your thoughts? Do you generally use Lambda Proxy or plain Lambda integrations? What do you prefer, and why?</p>
  
  <p><strong>EDIT</strong>: So far, I'm inclined to always choose not to use the proxy features due to the reasons mentioned (decoupling and stating dependencies -headers, status codes, etc- upfront).</p>