I am getting this error any time i call my lambda function. So i am running the API Gateway AWS Proxy test in the AWS Console just to test out the lambda, but i keep running into this error
{
"errorMessage": "'ResponseURL'",
"errorType": "KeyError",
"stackTrace": [
[
"/var/task/index.py",
110,
"handler",
"cfn_error(\"invalid request. Missing key %s\" % str(e))"
],
[
"/var/task/index.py",
29,
"cfn_error",
"cfn_send(event, context, CFN_FAILED, reason=message)"
],
[
"/var/task/index.py",
194,
"cfn_send",
"responseUrl = event['ResponseURL']"
]
]
}
My lambda is written in javascript. This is a very difficult problem to figure out since it is giving me the error output in python.
Here is the handler code
exports.handler = async function (event) {
console.log("request:", JSON.stringify(event, undefined, 2));
return {
statusCode: 200,
headers: { "Content-Type": "text/plain" },
body: `Hello, CDK! You've hit ${event.path}\n`
};
};
Here is the lambda initializer
const hello = new lambda.Function(this, 'HelloHandler', {
runtime: lambda.Runtime.NODEJS_14_X,
code: lambda.Code.fromAsset('lambda'),
handler: 'hello.handler'
});
````````````````````````````````