I have been trying to invoke simple lambda function in Python from Amazon Connect but not able to do so.
Error: The Lambda Function Returned An Error.
Function:
import os
def lambda_handler(event, context):
what_to_print = 'hello'
how_many_times =1
# make sure what_to_print and how_many_times values exist
if what_to_print and how_many_times > 0:
for i in range(0, how_many_times):
# formatted string literals are new in Python 3.6
print(f"what_to_print: {what_to_print}.")
return what_to_print
return None`
Now, whenever I try to invoke this function using CLI aws lambda invoke --function-name get_info outputfile.txt
.It runs successfully and produce the correct output.
Now the weird part is from Amazon Connect I am able to invoke any node.js lambda functions easily only Python functions producing an error.