Open ambsw-technology opened 5 years ago
Obviously, this request would not work as well with the -p
behavior (if that even works on init). You'd need to be able to select a specific path (e.g. /service/<service>/dev
or /service/<service>/prod
or the template would need to include sections for dev
and prod
containing all of the same text.
Did some digging. Per this SO answer, PyYAML discards comments when parsing. There are several other projects (some likely drop-in replacements) that could be used to support this.
Our legacy YAML files include inline documentation, e.g.
When extracting configurations from SSM, it'd be great to be able to preserve/leverage similar documentation. I'm not sure if any of the YAML parsers can preserve comments, but it would be nice if I could select a YAML file as a "template" and have it overwrite (or append) key-value pairs, preserving whatever documentation already exist.
Obviously, this would need to be combined with path-specific exports or adding new clients/services would be a mess. There would definitely be some edge cases (e.g. whether to repeat templates in lists), but it'd be useful to address the simplest/most general case and refine as-needed.