This module makes environment variables available as tokens within Drupal. You can use these tokens to dynamically insert the value of an environment variable into various parts of your site.
Environment for tokens
Provides tokens for environment variables.
It allows to define environment variables that will be available as tokens, using the following syntax: env:[ENV_VAR_NAME]. Those tokens will then be replaced by the Token Service.
Drupal 7
There is a Drupal 7 compatible module called token_env.