Closed bryant8317 closed 1 year ago
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue was automatically closed because of stale in 10 days
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
According to the documentation, npm_requirements controls whether npm install is run when building a package. However, it does not work correctly.
When setting source_path directly to the directory's path with package.json, the build plan it creates contains the npm step.
Terraform Snippet:
Build Plan:
However, when I add npm_requiremetns and prefix_in_zip to the terraform template, the build plan no longer contains the npm step.
Terraform Snippet:
Build Plan:
Versions
Reproduction Code [Required]
Run
terraform plan
with the following templateExpected behavior
I expect to see npm step in the build plan similar to below
Actual behavior
Additional context
I have checked package.py and found the following line https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/2e9aaa2d37d61299bfdaa8b919a75cb37f4726b7/package.py#L794
It seems like package.py is not getting the correct parameter (npm_requirements). In fact, when I add npm_package_json to my terraform template. The build plan behaves correctly as I expect.
I think this line in package.py will need to be changed to
I will use npm_package_json as a workaround in the meanwhile