terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
885 stars 658 forks source link

fix: Zip source directory should read from sh_work_dir #560

Closed ANGkeith closed 2 months ago

ANGkeith commented 2 months ago

fixes #557

Description

adding back the declaration of sh_work_dir that was removed in #534 because the variable is required and consumed here

Also, had to refactor to write to a tempfile instead of using the fd

because in systems where /bin/sh -> /bin/dash, it would throw the following error image

antonbabenko commented 2 months ago

Thanks for the contribution and for the review. I agree, that this code will most likely break for Powershell users but I am still unsure if this module is even working for people who are not using Windows emulators like cygwin. Let's review this PR as for Mac/Linux usage, and fix/improve it if necessary for Windows later (unless someone wants to check it on Windows).

pdecat commented 2 months ago

We probably want to remove the powershell mention from this comment then: https://github.com/terraform-aws-modules/terraform-aws-lambda/pull/534/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R442

antonbabenko commented 2 months ago

This PR is included in version 7.2.6 :tada:

github-actions[bot] commented 1 month ago

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.