Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Make quiet_archive_local_exec properly suppress Poetry/pip/npm output #709

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

Conversation

@ruhrohraggy
Copy link
Contributor

@ruhrohraggy ruhrohraggy commented Oct 8, 2025
edited by antonbabenko
Loading

Description:

The quiet_archive_local_exec variable was not being honored by the actual packaging subprocess calls in package.py. This change passes the
quiet flag from Terraform to the Python script and suppresses all packaging output when enabled.

Problem:

• quiet_archive_local_exec only suppressed Terraform's local-exec output, not the actual packaging commands
• Poetry, pip, npm, and zip subprocess calls were still producing verbose output during builds
• Users experienced noisy Terraform output during Lambda packaging operations

Solution:

• Pass quiet flag from Terraform → package.py → build plan → subprocess execution
• Suppress stdout/stderr in Poetry, pip, and npm check_call() when quiet=true
• Suppress zip creation and file logging in ZipWriteStream when quiet=true
• Suppress completion messages when quiet=true

Changes Made:

  1. package.tf: Pass quiet_archive_local_exec to external data source and local-exec
  2. package.py:
    • Add quiet to build plan data in prepare_command
    • Suppress Poetry/pip/npm subprocess output when query.quiet is true
    • Add quiet parameter to ZipWriteStream class
    • Suppress zip logging and completion messages when quiet mode enabled
  3. examples/build-package: Add demonstration of quiet packaging functionality
  4. Documentation: Update README to explain quiet packaging feature

Testing:

• [x] Added package_dir_poetry_quiet example demonstrating quiet_archive_local_exec = true
• [x] Verified Poetry, pip, npm, and zip output is suppressed in quiet mode
• [x] Confirmed backward compatibility - no output change when quiet_archive_local_exec = false
• [x] All pre-commit hooks pass successfully

Breaking Changes:

None. This is a backward-compatible bug fix.

Resolves:

fixes #706 - quiet_archive_local_exec not working for Poetry/pip/npm output
• Provides truly quiet Lambda packaging builds for cleaner Terraform output

hristost-pearl and jasonyoung-pearl reacted with thumbs up emoji
@ruhrohraggy ruhrohraggy force-pushed the fix-quiet-archive-poetry-output branch 2 times, most recently from 2b74a51 to 64c6e71 Compare October 8, 2025 21:00
@ruhrohraggy ruhrohraggy marked this pull request as draft October 8, 2025 21:12
@ruhrohraggy ruhrohraggy force-pushed the fix-quiet-archive-poetry-output branch 2 times, most recently from 99c324d to 7555e62 Compare October 8, 2025 21:19
...utput
- Pass quiet flag from Terraform to package.py via query data
- Add quiet flag to build_data dictionary in prepare_command
- Suppress stdout/stderr in Poetry, pip, and npm subprocess calls when quiet=true
- Add example demonstrating quiet packaging functionality
- Update documentation and apply formatting fixes
Fixes issue where quiet_archive_local_exec only affected Terraform's local-exec
output but not the actual Poetry/pip/npm subprocess calls within package.py.
Resolves terraform-aws-modules#706 
@ruhrohraggy ruhrohraggy force-pushed the fix-quiet-archive-poetry-output branch from 7555e62 to 3d1b3e3 Compare October 8, 2025 21:22
@ruhrohraggy ruhrohraggy marked this pull request as ready for review October 8, 2025 21:51
Copy link
Contributor Author

@antonbabenko just tagging for visibility! Appreciate any time you have to review

Copy link

Hey @ruhrohraggy - thanks for working on this! I've been testing out your PR and found that it's missing a variable declaration for quiet_archive_local_exec. Other than that it seemed to work well.

ruhrohraggy reacted with heart emoji

Copy link
Member

ruhrohraggy reacted with thumbs up emoji

Copy link
Contributor Author

@hristost-pearl quiet_archive_local_exec is there already - https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/master/variables.tf#L807-L811 ... or not?

Should be... Like #706 pointed out, it was just that the variable didn't seem to be getting applied as expected.

antonbabenko reacted with rocket emoji

@antonbabenko antonbabenko merged commit bae0385 into terraform-aws-modules:master Oct 22, 2025
30 checks passed
antonbabenko pushed a commit that referenced this pull request Oct 22, 2025
## [8.1.2](v8.1.1...v8.1.2) (2025年10月22日)
### Bug Fixes
* Make quiet_archive_local_exec properly suppress Poetry/pip/npm output ([#709](#709)) ([bae0385](bae0385))
Copy link
Member

This PR is included in version 8.1.2 🎉

Copy link
Contributor Author

Thanks @antonbabenko !

antonbabenko reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@antonbabenko antonbabenko antonbabenko approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Quiet_archive_local_exec var doesn't work

AltStyle によって変換されたページ (->オリジナル) /