I am new to lambda, succeeded in creating lambda functions through console and triggered them. but when i am trying to invoke them using AWS CLI, i am facing issues.
my lambda function (python) is simple and just prints the input arguments and tested successfully in console.
i am calling like below in cli from a windows machine,
aws lambda invoke --function-name testfn --invocation-type RequestResponse --payload '{"a":"b"}' outfile.txt
the error says - Invalid base64: "'{a:b}'"
But if i give an empty payload like -
aws lambda invoke --function-name testfn --invocation-type RequestResponse --payload '{}' outfile.txt
it is getting succceded with below output.
{
"StatusCode": 200,
"ExecutedVersion": "$LATEST"
}
So what is going wrong with my payload? Please help.
What does this error mean ? Invalid base64: "'{a:b}'"
I had also tried giving payload from a json file and passing that file with exact path in the command, still same error.