Since 0.2.0, JSON dictionaries (aka Associative Arrays in JSON-speak) have been sorted by
key, which is great. It works fine when Terraform uses JSON dictionaries to implement key-value maps (aka dictionaries aka hash'es in programmer-speak).
But, Terraform sometimes implements key-value maps as "array of key-value-pair".
For example, task-definition changes for services often cause log.plan lines such as:
In my development environment, these lists are usually dozens of elements long, and the spurious change-reports (such as "a" and "c" above) are almost impossible to reliably separate from actual differences.
Sorting these arrays by key (in this case, "name") greatly improves the output quality:
Since 0.2.0, JSON dictionaries (aka
Associative Arrays
in JSON-speak) have been sorted by key, which is great. It works fine when Terraform uses JSON dictionaries to implement key-value maps (aka dictionaries aka hash'es in programmer-speak).But, Terraform sometimes implements key-value maps as "array of key-value-pair". For example, task-definition changes for services often cause log.plan lines such as:
The value of "b" has changed. The other items did not change value, but did change position.
If the arrays are not sorted, the diff looks like:
In my development environment, these lists are usually dozens of elements long, and the spurious change-reports (such as "a" and "c" above) are almost impossible to reliably separate from actual differences.
Sorting these arrays by key (in this case, "name") greatly improves the output quality:
Only the value that actually changed, "b", is shown as a difference.
An implementation of this feature is here https://github.com/coinbase/terraform-landscape/pull/75