Sam local Invoke lambda with local layer error
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
**Description:**
When invoking a function locally, which relies on a layer built locally as well, the function cannot find the module which is part of the layer.
When uploading that layer through the AWS console, and changing the Layer's reference in the template.yaml file, the import works.
The layer is 17Mb zipped, and contains the mysql-connector-python module, as well as the requests module.
**Steps to reproduce the issue:**
1. Have a larger than 10MB layer (maybe more, just took the recommended max size from AWS console)
2. Import layer's package and run `sam local invoke FunctionName`
3. Deploy the layer manually in AWS console
4. Run `sam local invoke FunctionName` again after changing the lambda's layers property to the remote ARN in `template.yaml`.
**Observed result:**
Failure when calling Layer locally:


**Expected result:**
Calling layer locally or from remote have the same output.
Contributor guide
Assessment
This issue has not been assessed yet.