dineshba / tf-summarize

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

Does not list attributes that will be updated in output #10

Closed myoung34 closed 2 years ago

myoung34 commented 2 years ago
$ terraform show -json tfplan | tf-summarize                                                                               
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| CHANGE |                                                                           NAME                                                                           |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| update | uptycs_alert_rule.AWS_ApiGateway_Rest_API_active_tracing_is_disabled                                                                                     | 
+        +----------------------------------------------------------------------------------------------------------------------------------------------------------+ 
|        | uptycs_alert_rule.AWS_ApiGateway_Rest_API_certificates_are_not_rotated_periodically                                                                      |
+        +----------------------------------------------------------------------------------------------------------------------------------------------------------+
|        | uptycs_alert_rule.AWS_ApiGateway_Rest_API_does_not_have_CloudWatch_logging_enabled                                                                       |
+        +----------------------------------------------------------------------------------------------------------------------------------------------------------+ 
|        | uptycs_alert_rule.AWS_ApiGateway_Rest_API_does_not_have_CloudWatch_metrics_enabled                                                                       |
+        +----------------------------------------------------------------------------------------------------------------------------------------------------------+ 
|        | uptycs_alert_rule.AWS_ApiGateway_Rest_API_does_not_have_Web_Application_Firewall                                                                         | 
+        +----------------------------------------------------------------------------------------------------------------------------------------------------------+ 
|        | uptycs_alert_rule.AWS_ApiGateway_Rest_API_does_not_have_content_encoding_enabled                                                                         |
+        +----------------------------------------------------------------------------------------------------------------------------------------------------------+
|        | uptycs_alert_rule.AWS_ApiGateway_Rest_API_is_not_using_client_certificates                                                                               |
+        +----------------------------------------------------------------------------------------------------------------------------------------------------------+
|        | uptycs_alert_rule.AWS_CloudTrail_is_not_enabled_in_a_region                                                                                              | 

Ubuntu 22.04 LTS

$ tf-summarize -v       
Version: 0.2.2
dineshba commented 2 years ago

Could you give some more details ? @myoung34

What is the output of terraform plan ? (you can mask the sensitive details and share the data)

dineshba commented 2 years ago

Based on my understanding of your question. I am answering below

This tool will only show the summary of the terraform plan (like what is going to get updated/created/deleted/recreated). If we want to see the details of it, we should see the terraform plan or terraform show tfplan

Example usage:

terraform plan -out=tfplan # this is will print the detailed output
terraform show -json tfplan | tf-summarize   # See the summary, if needed see the details above
myoung34 commented 2 years ago

It's a very large plan, but its a lot of this

  # uptycs_alert_rule.Wbadminexe_execution_detected__T1490__Inhibit_System_Recovery__Windows will be updated in-place
  ~ resource "uptycs_alert_rule" "Wbadminexe_execution_detected__T1490__Inhibit_System_Recovery__Windows" {
      ~ event_tags     = [
            # (6 unchanged elements hidden)
            "process_events",
          + "RSIC_DISABLED",
        ]
      ~ id             = "ab6b5431-c8c7-4e5a-810a-331298fb6f15" -> (known after apply)
        name           = "Wbadmin.exe execution detected - T1490 - Inhibit System Recovery - Windows"
        # (9 unchanged attributes hidden)
    }

  # uptycs_alert_rule.WinRarexe_execution_detected__T1560001__Archive_via_Utility__Windows will be updated in-place
  ~ resource "uptycs_alert_rule" "WinRarexe_execution_detected__T1560001__Archive_via_Utility__Windows" {
      ~ event_tags     = [
            # (7 unchanged elements hidden)
            "process_events",
          + "RSIC_DISABLED",
        ]
      ~ id             = "2d843ba5-d771-4c87-8ec5-3e82ddbaaff6" -> (known after apply)
        name           = "WinRar.exe execution detected - T1560.001 - Archive via Utility - Windows"
        # (9 unchanged attributes hidden)
    }
dineshba commented 2 years ago

What is the actual output of the tf-summerize ? and what is the expected output ?

myoung34 commented 2 years ago

That is the output from tf-summarize. I cant post the entire thing, it's quite large

I'd expect it to show .event_tags in the row to show what attribute is changing

dineshba commented 2 years ago

Oh okay. Today, it only supports just the resource name. We can add that feature in upcoming releases.

Initial thought, tf-summarize -detailed should show the changing properties.

myoung34 commented 2 years ago

Screenshot_20221016-141302 I guess I'm confused. The gif seems to show that it would list the attributes in the plan

Edit: nevermind I see now. That was my misunderstanding

dineshba commented 2 years ago

Okay cool. I will close the issue then. Thanks for trying out the look @myoung34