question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Omit Lambda Layers from being bundled

See original GitHub issue

How can you omit Lambda layers from being bundled in your Lambda functions? Is this supported?

import { myFunc } from '/opt/my-layer'

Related issue, but the author closed it without saying why: https://github.com/serverless-heaven/serverless-webpack/issues/487

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

4reactions
alessaloisiocommented, Apr 1, 2020

Hello you can do something like this

// eslint-disable-next-line no-undef
const {global} = __non_webpack_require__("/opt/config");
2reactions
alexbondifycommented, Apr 5, 2021
module.exports = {
  //...
  externals: [nodeExternals(), /^\/opt/, 'aws-sdk'] // exclude Lambda Layers
  //...
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using layers with your Lambda function - AWS Documentation
Configuring layers with the console · Open the Functions page of the Lambda console. · Under Additional resources, choose Layers. · Choose the...
Read more >
Exclude packages included in Lambda layers from being ...
I'm using pipenv to manage my dependencies. To test locally I need the dependencies that are in the layers to be in my...
Read more >
How to Build Both Kinds of AWS Lambda Layers. (Yes, There ...
When you deploy a Lambda function to the cloud, it must have all of the dependencies bundled with it. If you use AWS...
Read more >
Functions - Reuse code & assets using layers - Amplify Docs
To remove a Lambda layer, run the amplify function remove command and select Lambda layers . Next, you'll be prompted to select which...
Read more >
How to use Lambda Layers in your serverless app - SST.Dev
We'll be using the chrome-aws-lambda Layer to take a screenshot of a webpage ... in a Layer layers: [layer], // Exclude bundling it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found