Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add change counters #85

Open
AnatoliKlamerGP opened this issue Dec 2, 2024 · 1 comment
Open

Add change counters #85

AnatoliKlamerGP opened this issue Dec 2, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@AnatoliKlamerGP
Copy link

AnatoliKlamerGP commented Dec 2, 2024

When running terraform plan, the output includes a summary of resource changes (e.g., how many resources will be created, updated, or destroyed). However, it can be tedious to quickly identify the total number of destroyed resources, which is often the most critical information to check.

Adding a similar high-level summary to tf-summarise would make it more user-friendly and align with common usage patterns.

Proposed Solution
Include a summary of changes in the output, formatted like:

|---module (+10, ~3, -2 in red)
|	|---my_module
|	|	|---module
|	|	|	|---ecs_alb
|	|	|	|	|---aws_lb (+1)
|	|	|	|	|	|---this[0](+)
|	|	|	|	|---aws_lb_listener (-2)

Table:

....
Saved the plan to: tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan"
+--------+-------------------------------------------------------------------------------------------+
| CHANGE |                                         RESOURCE                                          |
+--------+-------------------------------------------------------------------------------------------+
| add (2 in green)    | module.my_modules.aws_appautoscaling_policy.this["cpu"]    |
+                              +-------------------------------------------------------------------------------------------+
|                                | module.my_modules.aws_appautoscaling_policy.this["memory"]    |
+                              +-------------------------------------------------------------------------------------------+
+--------+-------------------------------------------------------------------------------------------+

Thoughts?

@nitrocode
Copy link

Yes this would be fantastic

I'd love to see this format instead so we can see the total and can see each change enumerated in case we want to comment on them

+----------+-----------------------------------------------------------------------------------------------+
|  CHANGE  |  #  |                                               RESOURCE                                  |
+----------+-----------------------------------------------------------------------------------------------+
| add (5)  |  1  | module.snip.module.accounts_role.aws_iam_role_policy.lambda                             |
+          +-----------------------------------------------------------------------------------------------+
|          |  2  | module.snip.module.step_function.aws_cloudwatch_log_group.log_group_for_sfn             |
+          +-----------------------------------------------------------------------------------------------+
|          |  3  | module.snip.module.step_function.aws_sfn_state_machine.state_machine                    |
+          +-----------------------------------------------------------------------------------------------+
|          |  4  | module.snip.module.step_function.aws_cloudwatch_log_group.log_group_for_sfn             |
+          +-----------------------------------------------------------------------------------------------+
|          |  5  | module.snip.module.step_function.aws_sfn_state_machine.state_machine                    |
+----------+-----------------------------------------------------------------------------------------------+

@dineshba dineshba added the help wanted Extra attention is needed label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants