The common pattern is to make anything you want to change externally configurable through the
stack configuration, which you can modify through your application code.
If you explain in a bit more detail what you're trying to achieve overall, chances are you'll find someone who has solved a similar problem before.