FerryDocs

Copy a variable with envVarKey

envVarKey copies the value of a variable of a different service during the apply.

Edit on GitHub
apiTOKEN=abcApplyworkerKEY not set

The apply reads the value of TOKEN in the service api.

1 / 4
ferry.yaml
services:
  - type: worker
    name: worker
    envVars:
      - key: KEY
        fromService:
          type: web
          name: api
          envVarKey: TOKEN

envVarKey gives a copy, not a . A later change of the source variable reaches the copy only at the next .

envVarKey works only with services, not with datastores.

Where the value comes from

  1. From the blueprint, when the other service has that key in its envVars.
  2. If not, from the saved environment of the service that exists.
  3. If no one has it, the apply leaves the variable with no value and gives a warning:
env var 'KEY' not copied: service 'api' has no variable 'TOKEN' yet

On this page