Configuration in YAML is fine, especially for non-full-time programmers.
But avoid coding in YAML (if conditions, looping, etc.). Use a DSL in a programming language instead.
Why? Because a DSL is not restricted (since it builds on top of a general-purpose language), and accomodates customization / complexity.
Plus, the DSL can generate the YAML, if the goal is to use YAML as the format of the input to the system.
An alternative to explore is CUE lang (via).
References
- A lesson in creating and using niche business DSLs at scale | Zerodha Tech
- YAML as data format is defensible. YAML as a programming language is not.
- KubeFlow DSL compiler that generates YAML vs. Argo Workflows YAML examples
- Hashicorp is providing general programming languages (TypeScript, Python) as an alternative to their custom config language (HCL) and JSON
- Kelsey Hightower on Kubernetes & YAML
- How to build a DSL in Kotlin
- Gradle Kotlin DSL
- Why shouldn’t I just use python code for configuration?
- HN discussion : Don’t use a DSL where a full programming language is what you need
- HN discussion : infrastructure as code/yaml