Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda Layers #183

Closed
rbenal opened this issue May 29, 2019 · 3 comments
Closed

Lambda Layers #183

rbenal opened this issue May 29, 2019 · 3 comments
Labels

Comments

@rbenal
Copy link

rbenal commented May 29, 2019

There is support for lambda layers ? or any advice to work with layers using lambda-local ?

@gpotter2
Copy link
Collaborator

As of today, no.

From what I understand, layers only consist in extracting a zip file to /opt.You could probably automate that in a single bash call. It's also probably doable within NodeJS with fs calls and some unzip library.

@rbenal
Copy link
Author

rbenal commented May 30, 2019

@gpotter2 thx for your answer, yes, layers only consist in extracting zip files to /opt dir, that is not a problem, my question is about to find a good way to develop locally and using lambda-local, at the moment the solution that I'm using is to create a symbolic link to /opt/nodejs an then in my code:

const m=require('/opt/nodejs/myFileToImport') [this way my code works on AWS and locally too]

if i don't make this symbolic link i have to put in my code this:

const m=require('/Path/to/My/FileToImport')[this does not work when I deploy the code to AWS].I
but with this solution i have to change the symbolic link with each project ... so my question is which is the best approach to work with lambda-local and layers? Thanks!

@gpotter2
Copy link
Collaborator

Your approach seems fine. I'm not sure I could be of much help from within lambda local
(Sorry for the delay btw)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants