-
Story
-
Resolution: Done
-
Undefined
-
ACM 2.11.0
-
2
-
False
-
None
-
False
-
-
-
GRC Sprint 2024-07, GRC Sprint 2024-08
-
No
Currently the only supported dictionary operation in policies is the `dig` function. In contrast to this, governance has a more rich set of functions for `list`.
While preparing ACM policies, having dictionary support will improve the flexibility of the templating language. Some of the functions that could be supported might be as follows ( http://masterminds.github.io/sprig/dicts.html ):
- Using `dict` to create variables of type dictionary
- Supporting `hasKey` function
- Supporting `merge`/`mustMerge` to merge multiple dictionaries
- Supporting `get`/`set`/`unset` functions on dictionaries
Having `dict` support will allow users to create map like structures so that accessing them is more convenient with keys - these keys might be decided by the end users too: such as creating a map of secrets where the key might be the value of a certain label and value can be the secret itself. Having merge support (since it also gives priority to the foremost parameters) and hasKey support will ensure the creation of dictionaries and control flow are easier.
Although the same result can be achieved with list, having map like structures might be much more convenient in certain cases and dictionary support might also eliminate the unnecessary `lookup` calls in certain cases.
- is documented by
-
ACM-11548 Update GRC templating doc with Sprig functions
- Closed