-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Quiet flag for plan command #16468
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
Comments
Hi @joshuaspence! I'm not sure why you're seeing the same resource mentioned multiple times for refreshing. That's some strange behavior that I don't have any explanation for. The output here should be more like:
With that said, I think if we were to do this we'd want to use a more specific option name, like maybe |
Oh, it's not really the same resource... we have a module that we use which essentially provides a wrapper around the |
Oh, aha! So this is another place we need to update the output to use the resource addressing syntax. (We did this for apply and plan output in a recent release, but missed "refresh" I suppose.) |
fwiw, Landscape is a good solution to this:
|
We have a lot of resources too. And our build pipeline consists from group of Terraform parts. It is very difficult to review multiple plans across hundreds of lines. Landscape is ruby tool. We have CI and also allow different engineers to run our pipeline too. They all have different environments on their workplaces. Installation of one more tool for large team of poorly connected people with absolutely different technical skills is a pain. We are using only Gradle + Terraform. Landscape is suitable only for advanced users. |
I beg to differ - it's quite simple, as I showed in my example above. If installing Ruby is a problem, stick it in a Docker container. In fact, a Dockerfile is provided. You could use Bash aliases to make the |
This is exactly what I was hoping to find — I'm running Terraform against a large number of AWS accounts and refreshes account for almost all of the output produced. It'd be really nice if there was a way to have that be silent unless an error occurs. |
You could redirect the output to script variable or temp file, then if the return status is non-zero echo it to stderr, e.g. something like
|
Is there any update on this request? I also find plans to be quite noisy, including when you're rendering a local file. +1 |
+1 to this as well. we generate a |
+1 agreed there is not much value of this output to the standard user |
This is useful with https://terraform-compliance.com/ as it requires you to generate a plan file to test against. Helps cut back on the noise when you need to run plans against multiple envs are part of the test suite. |
This was an issue for me while using github actions. The output of the plan became to large to postback to the pull request. To solve my issue, I did a refresh before the plan, then omitted the refresh from the plan step
|
+1 there is not much value of this output to the standard user |
FYI to people in this thread - with 0.14 refactoring the way that plans refresh the current state, @jbardin noted a few downsides to the refresh then plan workflow and @apparentlymart provided this alternative that avoids those downsides. For local development, creating an alias for this command will provide the same functionality that people currently get from refreshing before planning. terraform plan -out=tfplan >/dev/null && terraform show tfplan && rm tfplan |
n.b. this has a few drawbacks since anything which causes a prompt will display on stdin and the process will appear to have hung. I also changed it so the terraform plan -input=false -out=tfplan >/dev/null && terraform show tfplan ; rm tfplan (You could probably avoid the temporary file by duplicating stdout before redirecting it but that doesn't seem worth the loss of clarity) |
Any update on this? |
Is there anything happening? Although we're not seeing the same resource multiple times in the logs, we have several hundred resources that are being refreshed which is spamming the CI logs. |
Any updates on this ? 🙏 This flag would be really useful instead of a shell alias for 2 reasons
The logs become especially long and unreadable when
This also cause unintended limitations in the CI
|
Thanks for the continued feedback on this issue. This issue appears to be a precursor to a subsequent issue on the same topic, which has more recent consideration: #27214. Unfortunately #27214 likely should have been marked as a duplicate of this issue, but given that it was missed at the time, I am going to take the ahistorical action of marking this issue as a duplicate of #27214 so that we can consolidate the feedback. Thanks for your patience here, and please let me know if I missed something that distinguishes these two issues. |
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. |
Currently,
terraform plan
outputs a lot of "noise". For example:Often when making changes to our Terraform code, I will run
terraform plan
before and after making the change and compare the output in order to verify that the change is working as intended. This output, however, makes it harder for me to do so. It would be great if there was a-quiet
flag that could be used to suppress this output.The text was updated successfully, but these errors were encountered: