Defining file path based on environment variable

I am trying write up configuration file for vault agent and I need ENV variables to define the correct paths for role_id_file_path using approle method for auto_auth.

I also need to use ENV variables to define template sources for certificate files as well?

I am aware that hcl file don’t allow reading environment variables directly, but is there any work-around for doing this?

I use a script to load the configuration and use my own substitutions from template files with variables to generate .hcl files.

That’s what I ended up doing as well