Platform.sh is now Upsun. Click here to learn more
Upsun User Documentation

variables

Try Upsun for 15 days
After that, enjoy the same game-changing Upsun features for less with the First Project Incentive!¹ A monthly $19 perk!
Activate your 15-day trial
¹Terms and conditions apply

A variables dictionary that defines variables to control the environment.

Optional in single-runtime and composable images.

Upsun provides a number of ways to set variables. Variables set in your app configuration have the lowest precedence, meaning they’re overridden by any conflicting values provided elsewhere.

All variables set in your app configuration must have a prefix. Some prefixes have specific meanings.

Variables with the prefix env are available as a separate environment variable. All other variables are available in the PLATFORM_VARIABLES environment variable.

The following example sets two variables:

  • A variable named env:AUTHOR with the value Juan that’s available in the environment as AUTHOR
  • A variable named d8config:system.site:name with the value My site rocks that’s available in the PLATFORM_VARIABLES environment variable
.upsun/config.yaml
applications:
  myapp:
    type: 'python:3.13'
    source:
      root: "/"
    variables:
      env:
        AUTHOR: 'Juan'
      d8config:
        "system.site:name": 'My site rocks'
.upsun/config.yaml
applications:
  myapp:
    type: "composable:25.05"
    source:
      root: "/"
    stack: 
      runtimes: [ "python@3.13" ]
    variables:
      env:
        AUTHOR: 'Juan'
      d8config:
        "system.site:name": 'My site rocks'

You can also define and access more complex values.