When I am trying to test my python code on AWS Lambda I am getting the following error.
Response
{
"errorMessage": "Unable to import module 'lambda_function': No module named 'lambda_function'",
"errorType": "Runtime.ImportModuleError",
"stackTrace": []
}
These are the basic Setup steps which I followed to push my code into AWS Lambda:-
But after doing this I am getting this error
"errorMessage": "Unable to import module 'lambda_function': No module named 'lambda_function'",
"errorType": "Runtime.ImportModuleError",
I have made sure to check my Handler Info .
My code - Here I am trying to invoke execute_AWS_TF() function using lambda_handler()
import connect_mongoDB
def lambda_handler():
connect_mongoDB.execute_AMS_TF()
Working tree:
Directory Structure of my zip File:
Your lambda_function.py
is in a subfolder called AWS_REPORT...
. So you have the tell that to aws. The hendler info should be:
AWS_REPORT.../lambda_function.lambda_handler
Off course AWS_REPORT...
must be replaced by the actual name.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.