Documentation menu

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

ScopeSet onVisible to
Instance variablesOne service in one environmentThat instance only
Shared variablesOne environment of a projectAny service that references them
Service outputsPublished by a service (for example a database)Any service in the same environment that references them
Platform variablesInjected by ParslinksEvery 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 ${{ … }}:

PlaceholderResolves 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:

API_URL=http://api.${{PARSLINKS_ENVIRONMENT_NAME}}.internal:8080/v1
REDIS_URL=${{redis.REDIS_URL}}
SESSION_SECRET=${{secret(64)}}
DATABASE_URL=${{postgres.DATABASE_URL}}?sslmode=disable
bash4 lines

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

VariableDescription
PARSLINKS_PROJECT_ID, PARSLINKS_PROJECT_NAMEThe project
PARSLINKS_ENVIRONMENT_ID, PARSLINKS_ENVIRONMENT_NAMEThe environment
PARSLINKS_SERVICE_ID, PARSLINKS_SERVICE_NAMEThe service
PARSLINKS_INSTANCE_ID, PARSLINKS_WORKLOAD_ID, PARSLINKS_REVISION_IDRuntime identities
PARSLINKS_DEPLOYMENT_IDThe running deployment
PARSLINKS_PRIVATE_DOMAINThis service's private hostname
PARSLINKS_VOLUME_ID, PARSLINKS_VOLUME_NAMEThe attached volume, if any
PARSLINKS_REPLICA_ID, PARSLINKS_REPLICA_SLOT, PARSLINKS_REPLICA_REGIONPer replica (runtime only)
PORT, HOSTThe 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:

  1. Changing a variable does not change running replicas. It is a staged change that ships with the next Apply or deploy.
  2. Rolling back restores the old code and the old variable values.
  3. 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=true only in the preview environment.