You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next, I have created a script that installs the requirements.txt file in the layers/layerA, layers/layerB, layers/layerC in the python folder to then create a zip of this python file to get python.zip as instructed on AWS so that the end result is layers/basic/python.zip etc.
Then, following the instructions in the serverless documentation, I created a reference in the functions property in the serverless.yml file. For example, it looked like this:
After the deployment is done after using sls deploy command, when I test each function in AWS Lambda inline code editor, I get an error:
{
"errorMessage": "Unable to import module 'src.common.function_for_something.handler.handler': No module named 'alembic'",
"errorType": "Runtime.ImportModuleError",
"requestId": "262e019a-f242-4a44-95de-dd67af4a9dcf",
"stackTrace": []
}
The thing is that the layer is uploaded to AWS as a zip, which when unzipped has the structure as AWS requires, i.e. python/.
What am I doing wrong? What is missing from my configuration?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, my goal is to create three layers. I try to implement them basing on this articles:
I have 3 separate requirements.txt files located in layers-requirements/layerA, layers-requirements/layerB, layers-requirements/layerC.
I have created
layers
property in my serverless.yml file, which is set up like that:Next, I have created a script that installs the requirements.txt file in the layers/layerA, layers/layerB, layers/layerC in the python folder to then create a zip of this python file to get python.zip as instructed on AWS so that the end result is layers/basic/python.zip etc.
Then, following the instructions in the serverless documentation, I created a reference in the
functions
property in the serverless.yml file. For example, it looked like this:After the deployment is done after using sls deploy command, when I test each function in AWS Lambda inline code editor, I get an error:
The thing is that the layer is uploaded to AWS as a zip, which when unzipped has the structure as AWS requires, i.e. python/.
What am I doing wrong? What is missing from my configuration?
Beta Was this translation helpful? Give feedback.
All reactions