Platform
Variables & Configuration
Instance and shared variables, the ${{ }} reference syntax, generated secrets, platform variables, snapshots and how changes take effect.
Configuration on Parslinks is done with variables: key/value pairs injected as environment variables into your builds and containers. Variables can hold plain values or references to other services, shared values and platform data.
Where variables live
| Scope | Set on | Visible to |
|---|---|---|
| Instance variables | One service in one environment | That instance only |
| Shared variables | One environment of a project | Any service that references them |
| Service outputs | Published by a service (for example a database) | Any service in the same environment that references them |
| Platform variables | Injected by Parslinks | Every container |
Because variables are per environment, production and previews can use different values without any code changes.
Reference syntax
A value is plain text with optional placeholders in ${{ … }}:
| Placeholder | Resolves to |
|---|---|
${{postgres.DATABASE_URL}} | Output DATABASE_URL of the service postgres in the same environment |
${{shared.STRIPE_KEY}} | Shared variable STRIPE_KEY of this environment |
${{PORT}} | Another variable of the same service |
${{PARSLINKS_PRIVATE_DOMAIN}} | A platform variable |
${{secret(64)}} | A new random secret (64 bytes, base64url), generated once when you save |
Placeholders can be mixed with text:
Rules:
- Nested placeholders are rejected, and nothing is evaluated as code.
${{secret(N)}}is replaced by a real secret when you save; the stored value is the secret, not the expression.- A reference that cannot be resolved fails the deploy with a clear error instead of injecting an empty string.
The raw editor
The variables tab has a raw editor that accepts .env style lines (KEY=value). Comments and blank lines are ignored. Paste an existing .env file to import many variables at once.
Platform variables
| Variable | Description |
|---|---|
PARSLINKS_PROJECT_ID, PARSLINKS_PROJECT_NAME | The project |
PARSLINKS_ENVIRONMENT_ID, PARSLINKS_ENVIRONMENT_NAME | The environment |
PARSLINKS_SERVICE_ID, PARSLINKS_SERVICE_NAME | The service |
PARSLINKS_INSTANCE_ID, PARSLINKS_WORKLOAD_ID, PARSLINKS_REVISION_ID | Runtime identities |
PARSLINKS_DEPLOYMENT_ID | The running deployment |
PARSLINKS_PRIVATE_DOMAIN | This service's private hostname |
PARSLINKS_VOLUME_ID, PARSLINKS_VOLUME_NAME | The attached volume, if any |
PARSLINKS_REPLICA_ID, PARSLINKS_REPLICA_SLOT, PARSLINKS_REPLICA_REGION | Per replica (runtime only) |
PORT, HOST | The container port, and 0.0.0.0 unless you set HOST |
Per-replica variables are injected when each replica starts; they cannot be frozen into a snapshot, so do not reference them from shared variables.
Snapshots: when changes take effect
When a deployment is created, every variable is resolved and frozen into its environment snapshot. That has three consequences:
- Changing a variable does not change running replicas. It is a staged change that ships with the next Apply or deploy.
- Rolling back restores the old code and the old variable values.
- Promoting a preview deployment to production keeps the preview's values.
Sensitive values
Keys that look like secrets (containing PASSWORD, SECRET, TOKEN, or ending in _KEY, _URL, URI) are treated as sensitive: they are masked in the dashboard after saving. All values are encrypted at rest. To change a secret, overwrite it with a new value and redeploy.
Build time and runtime
Variables are available during the build and at runtime. Prefer reading secrets at runtime; values used while building can end up in image layers if your build writes them into files. See Builds & Artifacts.
Common patterns
- Database connection:
DATABASE_URL=${{postgres.DATABASE_URL}}. - Service-to-service URL:
USERS_API=http://users.${{PARSLINKS_ENVIRONMENT_NAME}}.internal:8080. - One key for all services: define it once as a shared variable and reference
${{shared.KEY}}where needed. - Per-environment flags: set
FEATURE_X=trueonly in the preview environment.
