Construct env vars from other values

Aug 4, 2026

You can now include references to other values in your environment variables. An example of where you might need this is database connection strings, which may reference the host, username and password values from elsewhere in your environment.

To add a reference to an environment variable type {{ in the value field. This opens a picker where you can select another value to reference, keep typing to filter. Once you make your selection, the reference drops in at your cursor:

postgres://dbuser:{{postgres.PASSWORD}}@{{postgres.host}}:{{postgres.port}}/app

References are keyed on the target service's hostname, and they reach further than variables. You can reference most values from other services including:

  • Private and public network information, including hostnames, ports and custom domain names
  • Other env vars and secrets, including other values from the same service
  • Resource limits such as CPU and memory

Values resolve at deploy time against the environment being deployed, and they resolve through each other, so a value can point at a variable that is itself a reference. We catch circular references before the deploy goes out.