hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io
Other
42.78k stars 9.56k forks source link

Decrease verbosity of plan command: "Refreshing state..." #25913

Closed andreitchaltsev closed 4 years ago

andreitchaltsev commented 4 years ago

There are already several feature requests to decrease the verbosity of terraform, e.g. #21639, #18467.

This request is much simpler: can terraform plan NOT output lines with "Refreshing state..."? (See example below)

For a typical run we have about 1000 of such lines, roughly 90% of all the outputs. When multiple TF applications have to be done going though all that text every single time becomes very considerable burden with no benefits at all.

The simplest solution here is to move "Refreshing state..." logs to a lower log level, e.g. DEBUG, but it is up to HashiCorp developers to choose the best approach.

Example output of terraform plan:

Terraform v0.12.26

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

module.role.module.read_write_role.data.terraform_remote_state.permission_boundary: Refreshing state...
module.role.module.read_role.data.terraform_remote_state.common_read_only: Refreshing state...
module.role.module.read_write_role.data.terraform_remote_state.common_read_only: Refreshing state...
module.role.module.read_role.data.terraform_remote_state.permission_boundary: Refreshing state...
module.role.module.elasticsearch_read_permissions.data.aws_partition.current: Refreshing state...
module.role.module.ses_read_write_permissions.module.ses_policies.data.aws_partition.current: Refreshing state...
module.role.module.kinesis_read_write_permissions.module.kinesis_policies.data.aws_partition.current: Refreshing state...
module.role.module.firehose_read_permissions.data.aws_caller_identity.current: Refreshing state...
<And so on, so on, so on...>
mildwonkey commented 4 years ago

Hi @andreitchaltsev, thank you for opening this ! It's most helpful to us if you add your use case to the existing issue, #21639, so we can consolidate the discussion. I am going to close this issue as a duplicate, since we do have other tickets covering it.

ghost commented 4 years ago

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.