I created a SAM application and want to debug it locally. The app has some dependencies which are specified in a Lambda Layer. This lambda layer is implemented and tested with other funtions - it runs ok.
I specified the need of this layer in templates.json:
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.7
Layers: arn:aws:l......:2
But when I Debug Locally I get the error that the dependencies do not exist in the Docker container that is being mounted locally. In this case is sqlalchemy:
Fetching lambci/lambda:python3.7 Docker container image......
Mounting C:\.....\Temp\aws-toolkit-vscode\...\output\awsToolkitSamLocalResource as /var/task:ro,delegated inside runtime container
START RequestId: ...... Version: $LATEST
[ERROR] Runtime.ImportModuleError: Unable to import module 'app___vsctk___debug': No module named 'sqlalchemy'
If I specify the dependencies in requirements.txt it works fine, but I understand that if I do this, the dependencies will be included in the deployment package, which I dont want.
How can I debug under a docker image that collects the dependencies of a layer?