Open utterances-bot opened 1 year ago
format("%.4d",key)
this saved our day
Great article!
I was still missing my use-case, so here it is: Transform list of objects into list of objects sorted by any key(like "name"): [for k, v in { for i in var.list : i.name => i } : v]
Terraform list of map ordering | netmemo.github.io
The need I went into some troubles when I wanted to implement NSXT rules. My aim was to keep the order of the rules as intended by the user when he wrote his data without asking him to enter a rule ID manually. If the order is kept then it’s easy to prioritize the rules according to their placement. With the NSX-T Terraform provider the rules are in the form below :
https://netmemo.github.io/post/tf-map-ordering/