This has been already asked a number of times, but I have tried everything suggested plus more, and nothing seems to work.
My setup: an application on Lambda, with python functions and deployed via CloudPipeline. This is the full error I get (and all I can see in the logs):
{
"errorMessage": "Unable to import module 'lambda_functions.function_one': No module named 'lambda_functions'",
"errorType": "Runtime.ImportModuleError"
}
lambda_functions is a directory, and function_one is the name of the python file with the handler in it. The full function invocation path in my template.yml is: lambda_functions.function_one.lambda_handler. I do have a __init__.py in that dir.
I installed the AWS SAM tools and I can invoke the function locally fine. I have also downloaded the zipped project from S3 and checked permissions etc.
The logs show that the requirements are installed correctly, but even then, just to make sure I tried commenting out everything in the function file except for a bare handler, no dependencies at all, and still fails.
Any ideas on why Lambda can fail to find my module?