coinbase / terraform-landscape

Improve Terraform's plan output to be easier to read and understand
Apache License 2.0
1.59k stars 116 forks source link

Support reordered items #109

Open nitrocode opened 4 years ago

nitrocode commented 4 years ago

Took this from an issue referenced below.

...
                      ~ Principal = {
                          ~ AWS = [
                              - "arn:aws:iam::1234567890:role/asnip",
                              - "arn:aws:iam::1234567890:role/psnip",
                                "arn:aws:iam::1234567890:role/wsnip",
                              - "arn:aws:iam::1234567890:role/csnip",
                              - "arn:aws:iam::1234567890:role/esnip",
                              + "arn:aws:iam::1234567890:role/psnip",
                                "arn:aws:iam::1234567890:role/lsnip",
                              + "arn:aws:iam::1234567890:role/esnip",
                              + "arn:aws:iam::1234567890:role/default",
                              + "arn:aws:iam::1234567890:role/csnip",
                              + "arn:aws:iam::1234567890:role/asnip",
                            ]
                        }
...

could be more readable in landscape if landscape could detect the reorder and show instead

                      ~ Principal = {
                          ~ AWS = [
                                "arn:aws:iam::1234567890:role/asnip",
                                "arn:aws:iam::1234567890:role/psnip",
                                "arn:aws:iam::1234567890:role/wsnip",
                                "arn:aws:iam::1234567890:role/csnip",
                                "arn:aws:iam::1234567890:role/esnip",
                                "arn:aws:iam::1234567890:role/lsnip",
                              + "arn:aws:iam::1234567890:role/default",
                            ]
                        }

FYI I see this issue in 0.11.x and 0.12.x so if it could be solved across versions and even only for policy statements like the above, that would be awesome.

Reference: