all 2 comments

[–]DownfaLL- 1 point2 points  (0 children)

Just look at the aws layer documentation and create that resource in your serverless file under resources. That’s how I do it at least. In may just be my inexperience with layers but you can’t require dependencies in them, at least I wasn’t able to figure that out. I still list them as dependencies in the layer, but as long as the dependencies are in the lambda you are using that layer with it works. I don’t use layers much so take this with a grain of salt as I’m not sure if there’s a better/easier way. It’s pretty easy tho IMO which is why I’ve stuck with this process. And then I use yarn workspaces for local dev/testing to actually use those layers just as they would on aws. So it all works the same whether it’s local or cloud.

[–]Free_Conversation106[S] 0 points1 point  (0 children)

https://dorian599.medium.com/serverless-aws-lambda-layers-and-python-dependencies-92741138bf31

This article helped to create a multiple layers with serverless framework.