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

Order of tf-summarize output is not consistent #88

Open
armst297 opened this issue Jan 6, 2025 · 0 comments
Open

Order of tf-summarize output is not consistent #88

armst297 opened this issue Jan 6, 2025 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@armst297
Copy link

armst297 commented Jan 6, 2025

When running tf-summarize on a json TF plan output, the resulting table does not always print in the same order, therefore making it more difficult to compare summaries.

Is there a way to force a consistent order? This makes it difficult to use for automating terraform deployments based on expected summarized changes.

E.g.) Running tf-summarize on the exact same plan json 3x in a row gives 2 different resulting tables (due to ordering)

$ cat terraform-plan-results.json | tf-summarize  
+----------+--------------------------------------------------------------------------------------------------------+
|  CHANGE  |                                                RESOURCE                                                |
+----------+--------------------------------------------------------------------------------------------------------+
| add      | module.client_infrastructure.module.ecs_task_definition_beatflower[0].aws_ecs_task_definition.ecs_task |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_service_beatflower[0].aws_ecs_service.ecs_service         |
+----------+--------------------------------------------------------------------------------------------------------+
| update   | module.client_infrastructure.module.ecs_task_service_web[0].aws_ecs_service.ecs_service                |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_service_worker[0].aws_ecs_service.ecs_service             |
+----------+--------------------------------------------------------------------------------------------------------+
| recreate | module.client_infrastructure.module.ecs_task_definition_web[0].aws_ecs_task_definition.ecs_task        |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_definition_worker[0].aws_ecs_task_definition.ecs_task     |
+----------+--------------------------------------------------------------------------------------------------------+
$ cat terraform-plan-results.json | tf-summarize  
+----------+--------------------------------------------------------------------------------------------------------+
|  CHANGE  |                                                RESOURCE                                                |
+----------+--------------------------------------------------------------------------------------------------------+
| update   | module.client_infrastructure.module.ecs_task_service_web[0].aws_ecs_service.ecs_service                |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_service_worker[0].aws_ecs_service.ecs_service             |
+----------+--------------------------------------------------------------------------------------------------------+
| recreate | module.client_infrastructure.module.ecs_task_definition_web[0].aws_ecs_task_definition.ecs_task        |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_definition_worker[0].aws_ecs_task_definition.ecs_task     |
+----------+--------------------------------------------------------------------------------------------------------+
| add      | module.client_infrastructure.module.ecs_task_definition_beatflower[0].aws_ecs_task_definition.ecs_task |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_service_beatflower[0].aws_ecs_service.ecs_service         |
+----------+--------------------------------------------------------------------------------------------------------+
$ cat terraform-plan-results.json | tf-summarize                      
+----------+--------------------------------------------------------------------------------------------------------+
|  CHANGE  |                                                RESOURCE                                                |
+----------+--------------------------------------------------------------------------------------------------------+
| add      | module.client_infrastructure.module.ecs_task_definition_beatflower[0].aws_ecs_task_definition.ecs_task |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_service_beatflower[0].aws_ecs_service.ecs_service         |
+----------+--------------------------------------------------------------------------------------------------------+
| update   | module.client_infrastructure.module.ecs_task_service_web[0].aws_ecs_service.ecs_service                |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_service_worker[0].aws_ecs_service.ecs_service             |
+----------+--------------------------------------------------------------------------------------------------------+
| recreate | module.client_infrastructure.module.ecs_task_definition_web[0].aws_ecs_task_definition.ecs_task        |
+          +--------------------------------------------------------------------------------------------------------+
|          | module.client_infrastructure.module.ecs_task_definition_worker[0].aws_ecs_task_definition.ecs_task     |
+----------+--------------------------------------------------------------------------------------------------------+
@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

2 participants