I just started with AWS and i am creating my first Lambda functions. The first one was success - no issues when creating and executing. Now i am trying to create Lambda function (python 3 based) with couple parameters. When i perform test from the API Gateway i can see it executes ok. When i try to execute from browser i see the following error: { "errorMessage": "'foo2", "errorType": "KeyError", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 6, in lambda_handler\n foo2 = event['foo2'];\n" ] }
Here is the function and mapping templates:
import json
import sys
def lambda_handler(event, context):
foo1 = event['foo1'];
foo2 = event['foo2'];
foo3 = event['foo3'];
foo = "This is Test!";
# TODO implement
return {
'statusCode': 200,
'body': json.dumps(event)
}
Mapping template
#set($inputRoot = $input.path('$'))
{
"foo1": "$input.params('foo1')",
"foo2": "$input.params('foo2')",
"foo3": "$input.params('foo3')"
}
I really wonder why this is happening..