I see many people talk about using mapping templates in the form of json object to make user agents and ip addresses available to Lambda functions?
Where are these json objects configured in the many control panels?
I see many people talk about using mapping templates in the form of json object to make user agents and ip addresses available to Lambda functions?
Where are these json objects configured in the many control panels?
Api gateway -> your api -> your endpoint/resource method -> integration request -> body mapping templates
Create one with a valid Content-type header such as
application/json
You can then pick a template or roll your own map.
For example the template which maps everything (available in the dropdown) is
You can also map lambda back to your api response with
Api gateway -> your api -> your endpoint/resource method -> integration response -> http status code -> body mapping templates
-- edit for comments
Note the expandable section at the bottom entitled Body mapping templates
-- edit #2 to explain how to get the mapped values in your lambda function
Go to APIs>YourApi >Resources>/request >POST >Integration Request
Scroll to the end of the page and click on Body Mapping Templates
Select a content-type, post which a template window will open below your selection. This is where you configure the mapping.