coinbase / terraform-landscape

Improve Terraform's plan output to be easier to read and understand
Apache License 2.0
1.59k stars 116 forks source link

Allow warnings to pass through to output #66

Closed rifelpet closed 6 years ago

rifelpet commented 6 years ago

The AWS Provider v2 upgrade has some breaking changes that results in some deprecated fields. Using these fields causes a warning to be emitted. Currently those warnings are suppressed by terraform-landscape, making it difficult to know whether we are ready for the v2 provider.

We use landscape in our centralized CI infrastructure where all plans and applies are ran. In order to confirm a lack of warnings we need to run every one of our plans locally without landscape which is a non-trivial effort.

It would be great if landscape allowed these warnings to pass through.

Example:

provider "aws" {
  version = "1.37.0"
}

data "aws_region" "this" {
  current = true
}

Raw plan:

$ terraform plan

Warning: data.aws_region.this: "current": [DEPRECATED] Defaults to current provider region if no other filtering is enabled

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.

data.aws_region.this: Refreshing state...

------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.

Current:

$ terraform plan | landscape
No changes

Expected:

$ terraform plan | landscape
Warning: data.aws_region.this: "current": [DEPRECATED] Defaults to current provider region if no other filtering is enabled

No changes
sds commented 6 years ago

Would happily accept a pull request!

rifelpet commented 6 years ago

New release looks great, thanks!

terraform plan | landscape
Warning: data.aws_region.this: "current": [DEPRECATED] Defaults to current provider region if no other filtering is enabled
No changes.