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

feat(lambda-nodejs): external and install modules #7870

Closed
wants to merge 3 commits into from

Conversation

jogold
Copy link
Contributor

@jogold jogold commented May 8, 2020

Commit Message

feat(lambda-nodejs): external and install modules (#7870)

Add support for:

  • external modules: modules that should not be bundled. Defaults to 'aws-sdk'.
    Can be used for modules already included in a Layer.
  • install modules: modules that should not be bundled but included in the
    node_modules folder of the Lambda package. Those modules are installed in a
    Lambda compatible Docker container
    with the right installer (npm or yarn) based on lock file detection.

Closes #6323

End Commit Message


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Add support for:
* external modules: modules that should not be bundled. Defaults to 'aws-sdk'.
Can be used for modules already included in a Layer.
* install modules: modules that should not be bundled but included in the
`node_modules` folder of the Lambda package. Those modules are installed in a
[Lambda compatible Docker container](https://github.com/lambci/docker-lambda)
with the right installer (`npm` or `yarn`) based on lock file detection.

Closes aws#6323
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 81c5ecc
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 03a7145
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: db43b30
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@orangewise
Copy link
Contributor

@jogold will this PR also help us in solving errors with node built-ins? Like this one:

Error: [Status 1] stdout: 🚨 /project/node_modules/bluebird/js/release/promise.js:34:12: Cannot resolve dependency 'async_hooks'
32 | };
33 | var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ?

34 | require("async_hooks").AsyncResource : null;
| ^
35 | var getContextAsyncHooks = function() {
36 | return {
37 | domain: getDomain(),

@jogold
Copy link
Contributor Author

jogold commented May 8, 2020

@orangewise Yes, it should do it with externalModules: ['async_hooks'].

@orangewise
Copy link
Contributor

Awesome @jogold , appreciate your contributions a lot.

@jogold
Copy link
Contributor Author

jogold commented May 8, 2020

Not ready yet, there's an issue with the parcel plugin here. Investigating.

@jogold jogold closed this May 8, 2020
@orangewise
Copy link
Contributor

Nice, hope it will be available soon 👍

@orangewise
Copy link
Contributor

Hi @jogold I see you closed this issue. Not sure if I understand how this get's merged now ;) Will it?

@jogold
Copy link
Contributor Author

jogold commented May 12, 2020

I prefer to get #7898 merged first, then I can go back to this.

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

Successfully merging this pull request may close these issues.

@aws-cdk/aws-lambda-nodejs doesn't build functions with native modules
3 participants