How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway

As of September 2017, you no longer have to configure mappings to access the request body.

All you need to do is check, “Use Lambda Proxy integration”, under Integration Request, under the resource.

enter image description here

You’ll then be able to access query parameters, path parameters and headers like so

event['pathParameters']['param1']
event["queryStringParameters"]['queryparam1']
event['requestContext']['identity']['userAgent']
event['requestContext']['identity']['sourceIP']

Leave a Comment