ReferenceBlueprint spec
Copy a variable with envVarKey
envVarKey copies the value of a variable of a different service during the apply.
The apply reads the value of TOKEN in the service api.
1 / 4
services:
- type: worker
name: worker
envVars:
- key: KEY
fromService:
type: web
name: api
envVarKey: TOKENenvVarKey gives a copy, not a reference. A later change of the source variable reaches the copy only at the next apply.
envVarKey works only with services, not with datastores.
Where the value comes from
- From the blueprint, when the other service has that key in its
envVars. - If not, from the saved environment of the service that exists.
- 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' yetTwo services can copy from each other in a circle. Ferry skips these copies with a warning.