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

terragrunt-forward-tf-stdout is not effective when redirecting output to a plan file with -out option #3772

Closed
proffase opened this issue Jan 16, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@proffase
Copy link

Describe the bug

--terragrunt-forward-tf-stdout option is not respected when plan is redirected to a plan file using -out planfile.txt
If plan file is then read with terragrunt show planfile.txt it contains STDOUT terraform information e.g.

terragrunt show planfile.txt 16:14:46.042 STDOUT terraform: Terraform used the selected providers to generate the following execution 16:14:46.044 STDOUT terraform: plan. Resource actions are indicated with the following symbols: ...

Steps To Reproduce

Generate any plan into a plan file with the option to print terraform output as is:
terragrunt plan --terragrunt-forward-tf-stdout -out planfile.txt

Try reading it plan file:
terragrunt show planfile.txt

Expected behavior

A plan file to have less verbose output similar to running terragrunt --terragrunt-forward-tf-stdout in cli without -out parameter.

Versions

  • Terragrunt version: 0.72.2
  • Terraform version: 1.9.8
  • Environment details (Ubuntu 20.04, Windows 10, etc.): MacOS 15.2

Additional context

--terragrunt-log-format bare has similar behavior - works when running interactively in cli, but is not respected when outputting into a plan file.

@proffase proffase added the bug Something isn't working label Jan 16, 2025
@yhakbar
Copy link
Collaborator

yhakbar commented Jan 16, 2025

Hey @proffase , thanks for opening this issue.

The problem is likely that you aren't using --terragrunt-log-format bare for the show command. The show command is what actually renders STDOUT from the plan binary. Could you please confirm?

If you can confirm, please feel free to submit a pull request updating the docs to make sure that others aren't surprised by this behavior.

@proffase
Copy link
Author

Yes, it really works as expected with terragrunt show --terragrunt-log-format bare planfile.txt
Thanks for the quick response!

I will look into a PR for documentation if I can find a correct sections for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants