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

(aws-lambda-nodejs): Expose AssetStaging.exclude as prop to ignore node_modules from fingerprinting #33627

Open
1 of 2 tasks
relm923 opened this issue Feb 28, 2025 · 2 comments
Labels
@aws-cdk/aws-lambda-nodejs effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@relm923
Copy link
Contributor

relm923 commented Feb 28, 2025

Describe the feature

Add bundling.exclude property to NodejsFunction that is passed to the Asset here

This would allow certain paths from being included in the fingerprint/assetHash giving developers more control without having to fully customize the hashing logic

Use Case

When using the NodejsFunction.nodeModules property the listed modules (and their dependencies) are included directly in the bundled asset. This leads to the containing node_modules directory to directly influence the calculated assetHash. The contents of node_modules can be unstable for a large number of reasons leading to unnecessary deployments

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.181.1

Environment details (OS name and version, etc.)

N/A

@relm923 relm923 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 28, 2025
@pahud
Copy link
Contributor

pahud commented Mar 2, 2025

Thank you. While this makes sense to me, we still need more inputs from the maintainers. I am bringing it up to the team for further inputs.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Mar 2, 2025
@relm923
Copy link
Contributor Author

relm923 commented Mar 3, 2025

This is particularly problematic due to

// --no-prefer-frozen-lockfile (works the same as yarn's --no-immutable) Disable --frozen-lockfile that is enabled by default in CI environments (https://github.com/pnpm/pnpm/issues/1994).
causing pnpm-lock.yaml and node_modules to change on every synth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants