Not a snarky question : what about having data and config in yml, and some high level tool like ansible or terraform and the occasional bash?
You loop and branch in ansible/terraform
I hate that setup but also I have a hard time thinking of something else