Yes this is the section that looks like a sad crossword of acronyms. You need to know when to use proxy integration and when to stop being lazy and write a mapping template. You also need to understand VTL mapping templates and how API Gateway and Lambda talk to each other without throwing a tantrum. This guide gives you the facts the exam wants and a few bad jokes you can ignore when nervous.
There are two main ways to hook API Gateway to Lambda. One passes the whole kitchen sink to your function. The other lets API Gateway do some light weight janitorial work first.
Mapping templates use VTL to turn incoming JSON form data or other formats into the shape your Lambda wants. These are tiny programs that run before your function gets the request and they matter for serverless integrations and the AWS Exam.
$input.json('$')
That little line passes raw JSON from the body into Lambda. If the exam shows that exact snippet your answer is probably non proxy integration unless they explicitly say proxy.
Headers appear in the request context and mapping templates must reference their exact names. For example you can use expressions like
$input.params('header-name')
For query string parameters use the params collection for querystring values. If you need path parameters those come from the path variable collection in the request context.
API Gateway must be allowed to invoke your Lambda. That happens by adding invoke permission to the Lambda resource policy for the API Gateway service principal. The exam loves to test whether you understand resource policies versus execution roles. Short version resource policies let services call your function. Roles let your code call other AWS services.
Lambda can fail in lots of creative ways. Mapping templates and integration responses let you translate those failures into the HTTP status codes you actually want the client to see. In non proxy integration you configure method response and integration response mappings and match on patterns from Lambda output to decide which HTTP status to return and what JSON body to send.
With proxy integration you must return a response structure that contains statusCode and body so API Gateway does not invent one for you.
Use one method as proxy and one method as non proxy when you practice. Deploy to stages and use stage variables to swap between environments. Stage variables can point to different Lambda ARNs or to different config values so your serverless setup behaves like an adult across dev test and prod.
There you go. You now have the high value exam facts about API Gateway Lambda integration mapping templates VTL permissions error mapping and deployment stages. Study this and the real pain of debugging serverless integrations will be half as bad as your instructor made it sound.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.