dineshba / tf-summarize

A command-line utility to print the summary of the terraform plan
MIT License
508 stars 32 forks source link

Terragrunt support #65

Open Alexey-Tsarev opened 7 months ago

Alexey-Tsarev commented 7 months ago

Hi! You have an interesting util, but suddenly it does not work with Terragrunt.

I tried, but I got the following error:

terragrunt run-all plan --terragrunt-non-interactive --terragrunt-working-dir ./vpc | tf-summarize
INFO[0000] The stack at ./vpc will be processed in the following order for command plan:
Group 1
- Module .../vpc

error when parsing input: invalid character '\x1b' looking for beginning of value
yyarmoshyk commented 6 months ago

The following approach can be used

  1. Update global terragrunt.hcl with the following:

    terraform {
    extra_arguments "auto_plan_file" {
    commands = [
      "plan",
    ]
    
    arguments = ["-out=tfplan.output"]
    }
    }

    Next run the following:

    find . -name tfplan.output -exec tf-summarize {} \;

But I don't really like the output. I think there is a need to add some filtering for resources that are not being updated:

+--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+
+--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+
+--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+
+--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+
armenr commented 6 months ago

+1 to terragrunt support. This would be a huge DX and quality-of-life improvement. I'd donate money to see that developed.

thiagomaeda commented 5 months ago

It would be great to have terragrunt support, the logs there are far from the ideal size.