Environment variables substitution within environment variables

Hey there! :wave:

I would like to reference one or more environment variables within another variable. My use case is to replace the default database name in Qovery’s MongoDB database URL (the /admin part).

Being able to set a value like this would be very nice:

mongodb://${QOVERY_MONGODB_ABC123_LOGIN}:${QOVERY_MONGODB_ABC123_PASSWORD}@{QOVERY_MONGODB_ABC123_HOST_INTERNAL}:27017/my_database_name

(I obviously tried this form of basic substitution and the magic didn’t happen!)

I couldn’t find anything similar in the documentation or the forum, is it something that is implemented in a way or another, or that you may want to add at some point?

Hi @ramnes :wave: ,

This is something we plan to add. I don’t have ETA yet but here is a workaround that you can follow at the moment. :point_down:

Doesn’t work very well in my situation as I want to minimize the changes to the codebase. I ended up building up the environment variable myself and just saving it as is.

Just found this on the roadmap, nice! Although, it is tagged for Q2 2022 and we’re in Q3. :sweat_smile: (I’m just nitpicking, there’s nothing urgent about it.)

Edit: fixed the link

1 Like

I see with the team (you’re right to be nitpicking)