I have recently started learning AWS and created a basic Node based lambda as below:
exports.handler = async (event, context, callback) => {
// TODO implement
const response = {
statusCode: 200,
body: JSON.stringify([event, context, 'Hello from Saurabh Tiwari']),
};
return response;
};
I have configured the API gateway method request to expect a name query parameter as shown below:

I have also assigned a request validator to the GET call for the API. Having done this the endpoint asks me to necessarily provide a query parameter.
The issue however is that I am unable to receive the query parameter in the lambda function. I expect it to be passed along the event parameter. However the event parameter (first parameter in the JSON body) is blank as can be seen in the response object below.
Please suggest how do I retrieve the query param in the lambda.

event.queryStringParameters[name]. I think you have to done some configuration wrong thats why APIGateway event which is supposed to be passed as a param is an empty object.{"errorType":"TypeError","errorMessage":"Cannot read property 'name' of undefined","trace":["TypeError: Cannot read property 'name' of undefined"," at Runtime.exports.handler (/var/task/index.js:6:58)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]}. The entire event object is blank for whatever reason.GETas you can see in your screenshot. There you would find integration request. Click on it then you would see some options including a checkboxlambda proxy integration. Check the checkbox and save. I would recommend you to use a framework likeserverless frameworkas they make config easier.