How to assign dynamic value to environment variable?

I’ve added a custom environment variable, can I assign a dynamic value to it.

For example:

MY_CUSTOM_VARIABLE=${{ RENDER_EXTERNAL_HOSTNAME }}
1 Like

I would call something like this in my start script:

export MY_CUSTOM_VARIABLE="$RENDER_EXTERNAL_HOSTNAME"

./start/my/app

That assumes, you’re using a start script. If you’re not, then putting something like this into the start command (in render service settings) should also work:

MY_CUSTOM_VARIABLE="$RENDER_EXTERNAL_HOSTNAME" ./start/my/app

I was hoping to do something like this

Maybe this can be a feature request?

Hi @mittalyashu, feel free to submit that request to feedback.render.com, you can upvote the request there to be notified of any updates!

Sure, Dynamic environment variable | Feature Requests | Render

1 Like

I can vouch for the power of this as our (Doppler) customers love using secrets referencing to build dynamic secrets.

doppler-secrets-referencing

1 Like