You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ terraform plan -out=tfplan
random_id.b: Refreshing state... [id=NFtC1Xo]
random_id.a: Refreshing state... [id=RJrHXAs]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
-/+ destroy and then create replacement
Terraform will perform the following actions:
# random_id.b must be replaced
-/+ resource "random_id" "b" {
~ b64_std = "NFtC1Xo=" -> (known after apply)
~ b64_url = "NFtC1Xo" -> (known after apply)
~ byte_length = 5 -> 10 # forces replacement
~ dec = "224869406074" -> (known after apply)
~ hex = "345b42d57a" -> (known after apply)
~ id = "NFtC1Xo" -> (known after apply)
}
# random_id.c will be created
+ resource "random_id" "c" {
+ b64_std = (known after apply)
+ b64_url = (known after apply)
+ byte_length = 10
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
}
Plan: 2 to add, 0 to change, 1 to destroy.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Saved the plan to: tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "tfplan"
$ ~/bin/tf-summarize tfplan
+----------+-------------+
| CHANGE | RESOURCE |
+----------+-------------+
| add | random_id.c |
+----------+-------------+
| recreate | random_id.b |
+----------+-------------+
$ ~/bin/tf-summarize -tree tfplan
|---random_id
| |---a
| |---b(-/+)
| |---c(+)
Expected output
The normal table view is correct, only showing changes to random_id.b and random_id.c. However, in tree view, the random_id.a is also (incorrectly) shown. I'd expect that output to omit random_id.a.
Downgrading to 0.3.7 and running the same shows the expected output:
$ terraform version
Terraform v1.7.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/random v3.6.0
$ ~/bin/tf-summarize -v
Version: 0.3.8
Introduction
I ran a git bisect between 0.3.7 and 0.3.8:
$ cat test.sh
#!/usr/bin/env bash
set -e
go build || exit 125
(cd ../ && terraform show -json tfplan) | ./tf-summarize -tree | ( ! grep -Fq -- '---a')
$ git bisect start v0.3.8 v0.3.7
Already on 'main'
Your branch is up to date with 'origin/main'.
Bisecting: 2 revisions left to test after this (roughly 1 step)
[908b8f01702cca83cdc5e5916ab714559c86f6aa] Add nil check for IsImport (#66)
$ git bisect run ./test.sh
running './test.sh'
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[b74b13da17e8c3390a56ae9e2efbcbad758b851a] [WIP] Feat: use terraform-json package (#60)
running './test.sh'
b74b13da17e8c3390a56ae9e2efbcbad758b851a is the first bad commit
The text was updated successfully, but these errors were encountered:
Daniel-I-Am
changed the title
Output form tree shows all unchanged resources since 0.3.8
Output format tree shows all unchanged resources since 0.3.8
Mar 11, 2024
The check for being a no-op requires r.Change.Importing to be present, which is probably not the case for most resources. I'll try to reproduce and fix later this week :)
This morning I updated our version of tf-summarize from 0.3.7 to 0.3.8 and the output has become very verbose in the
tree
format option.Example
I partially applied the following terraform code:
Real output
Expected output
The normal table view is correct, only showing changes to
random_id.b
andrandom_id.c
. However, in tree view, therandom_id.a
is also (incorrectly) shown. I'd expect that output to omitrandom_id.a
.Downgrading to 0.3.7 and running the same shows the expected output:
Environment info
Introduction
I ran a git bisect between 0.3.7 and 0.3.8:
Which points at this being introduced in #60
The text was updated successfully, but these errors were encountered: