I'm creating an API using AWS SAM with an API Gateway to pass requests to multiple Lambda handler functions.
I share code between them so I'd like to use Lambda Layers to avoid rewriting redundant code.
I'm initially starting out by testing my lambda layers locally, before creating any actual AWS resources. It seems that when I run my API locally, with sam local start-api
, my functions can't see the code in the layers. My guess is that's because layers have to be stored in S3 for SAM to be able to see them, otherwise, they won't be able to pull them down and add them to the Lambda function.
Is there a way to share code between SAM Lambda functions while testing locally, before creating any AWS resources?
Thanks for your help!
sam deploy
them – Chant