Tokens¶
Tokens are named text values that can be referenced from environment variables and other generated configuration.
A token can either:
- have a fixed plain value
- use a regular expression to generate a random secret value when the app environment or app service is created or updated
In an app service, token definitions are composed across several levels. Later levels override earlier ones when they use the same token name and the same environment type:
- service-defined tokens
- stack-wide tokens
- stack-service tokens
Tokens with different environment types are separate definitions. When a token is resolved at runtime, an environment-specific token takes precedence over a token without an environment type.
After tokens are materialized on an app service, the app-service token records are the effective runtime values. During
a stack upgrade, enabling Override tokens recreates those app-service tokens from the latest service and stack
definitions; leaving it disabled keeps the existing app-service token values. Existing generated values are preserved
when the latest definition still generates the same token name for the same environment type. This prevents a stack
upgrade from rotating database passwords and other generated credentials. Rotate such a credential explicitly when a
new value is required.
Token names¶
Token names that start with wodby_ are reserved for tokens that Wodby provides. You cannot define a token with such a
name in a service or stack template, or add one to an app service, stack, or stack service. Importing or updating a
service or stack template also fails when an environment variable references a wodby_ token that Wodby does not
provide, so the mistake is reported before deployment.
If a deployment fails with Unknown wodby token, rename the token so that it does not start with wodby_, and update
the environment variables that reference it.
Where tokens are supported¶
Tokens are commonly supported in:
- environment variable values defined by services, stacks, apps, links, imports, and workloads
- Helm values such as
helm.values[].valueand other service manifest fields that feed values into a Helm chart - config contents when
configs[].processTokens: trueis enabled - action arguments, database actions, backup actions, and similar generated runtime configuration
Secret tokens in environment variables¶
Generated tokens are always secret. A fixed-value token is secret when its effective service, stack, stack-service, or app-service definition marks it as secret.
When an environment variable directly references a named token, Wodby automatically carries that classification into the resolved environment variable. The destination becomes secret even when the token is embedded in a larger value, and the complete resolved value is stored in a Kubernetes Secret. The environment-variable definition does not need a duplicate secret flag.
This propagation is intentionally limited to direct named tokens. References under structured namespaces such as
links, integrations, database, certs, and keys still require the destination environment variable to be
marked secret explicitly. See Environment variables.
app¶
app.id: application ID, not app environment IDapp.name: application machine nameapp.title: application title
Legacy wodby_app_name still resolves to the same value as app.name. Use app.name in new templates.
instance¶
instance is the legacy token namespace for an app environment. It remains available for template compatibility.
instance.id: app environment IDinstance.name: app environment machine nameinstance.namespace: Kubernetes namespace for the app environmentinstance.title: app environment title
kubernetes¶
kubernetes.id: Kubernetes cluster IDkubernetes.externalID: cluster external IDkubernetes.name: cluster machine namekubernetes.fullName: cluster full name
env¶
Use env.type for behavior that depends on an environment type. Use instance for app environment identity.
The other env tokens remain available for template compatibility.
env.id: environment IDenv.name: environment machine nameenv.title: environment titleenv.type: environment type
org¶
org.id: organization ID
service¶
service.id: app-service IDservice.name: app-service machine nameservice.title: app-service titleservice.host: app-service hostnameservice.fqdnPrefix: generated host prefix used for domainsservice.primaryURL: primary URL for the service, including scheme when a primary domain existsservice.primaryHost: primary domain name for the serviceservice.mainPort.number: port number of the primary port on the primary endpointservice.mainPort.protocol: protocol of the primary port on the primary endpointservice.replicas: app-service replica countservice.secrets.env: generated Kubernetes Secret name used for secret environment variables
The service.secrets.env Secret holds the service's secret environment variables: those marked secret: true and
those that reference a secret token, such as a generated one. Each variable is a key named after it. A chart that reads
a password from a named Secret key can use this token as the Secret name: Wodby creates the Secret whenever the
service has secret variables, even if no container mapping uses it. The next deployment after a secret value changes
restarts the pods, so a chart that reads the Secret only at startup picks up a rotated password. When a container
mapping renders the Secret, it holds only the variables of mapped containers, and only their workloads restart.
Each endpoint's primary route is available as service.endpoints.[endpoint-name].[field]:
primaryHost: domain name of the endpoint's primary routeprimaryURL: URL of the endpoint's primary route, withhttps://when the route has a certificate andhttp://otherwise
Both are empty while the endpoint has no primary route or its primary route is disabled. Use them for a chart with more
than one public HTTP endpoint, such as an application with a separate container registry host. When one of these
values changes, the app environment is marked as needs redeploy, as it is for the service's own primary domain.
Named endpoint ports are available as service.endpoints.[endpoint-name].ports.[port-name].[field]:
number: manifest-defined internal port numberprotocol: port protocolpublicPort: assigned public port number, or an empty value while the port is unpublishedeffectivePort: assigned public port number when published, otherwise the manifest-defined internal number
Use effectivePort when a chart needs one usable value before and after publication. Publishing or unpublishing a
port marks the app environment as needs redeploy when the service reads that port's publicPort or effectivePort.
When a chart renders its Kubernetes Service port from this value, also set the service port's
routeToPublicPort field.
When a Helm value consists of exactly one number, publicPort, or effectivePort token, Wodby passes it to the
chart as a number, so charts that validate ports as numbers accept it. An unpublished publicPort stays an empty string,
so use effectivePort when the chart requires a number. Inside a longer value, such as
ssh://[email protected]:{{service.endpoints.ssh.ports.ssh.effectivePort}}, the token is replaced as text.
Legacy service.helm.release is still supported for backward compatibility.
helm¶
helm.release: resolved Helm release name for the current app service
Use this token when a chart exposes labels, selectors, or values keyed by the Helm release name.
stack¶
stack.id: stack IDstack.name: stack machine namestack.title: stack titlestack.version: stack versionstack.rev.id: stack revision IDstack.rev.number: stack revision number
database¶
Available when the current app-service context exposes a database.
database.host: database hostname. This is private when accessed through an app service with a private database user, otherwise publicdatabase.port: database connection port. This is private when available, otherwise publicdatabase.driver: database driver, based on the database kinddatabase.url: connection URL that includes the username and password, such aspostgresql://user:password@host:5432/db. MariaDB and MySQL use themysqlscheme. Mark environment variables that use itsecret: truedatabase.jdbcUrl: JDBC URL for Java applications, such asjdbc:postgresql://host:5432/db. It starts withjdbc:postgresql:,jdbc:mariadb:orjdbc:mysql:, matching the database kind, and does not include the username or password: passdatabase.user.nameanddatabase.user.passwordseparately. Not available for MongoDB. No TLS settings are added; for a MariaDB server that requires TLS, addsslModeto the URL in the applicationdatabase.ssl:truewhen Wodby connects to the database server with TLS, otherwisefalsedatabase.root.name: database superuser usernamedatabase.root.password: database superuser passworddatabase.user.name: database username for the current app-service contextdatabase.user.password: database user password for the current app-service contextdatabase.db.name: database name for the current app-service contextdatabase.db.charset: database charset for the current app-service contextdatabase.db.collation: database collation for the current app-service context
links¶
Accessed as links.[name].[token].
links.[name].host: linked app-service hostnamelinks.[name].port: primary port of the linked app service's primary endpointlinks.[name].service.*: service token from the linked app service. Seeservicelinks.[name].instance.*: app environment token from the linked app service. Seeinstancelinks.[name].env.[env-var-name]: environment-variable value from the linked app servicelinks.[name].tokens.[token-name]: token value from the linked app servicelinks.[name].database.*: database token from the linked app service. Seedatabaselinks.[name].database.caFile: path of the linked managed database server's CA certificate, mounted at the link'sdatabase.ca.filepath. Empty when the server has no CA certificatelinks.[name].values.[value-name]: a link value: the value a user entered for a custom target, or the value'sfromevaluated against the linked app service. Empty for an optional value that is not setlinks.[name].exports.[export-name]: an export of the linked app service, evaluated for this app service's location
Inside a link's own env and helm, link.* is short for links.[that link].*.
For a link to an app service of another app environment, only values.* and exports.* resolve. The other tokens are
empty, so a service shares only what it exports. A link with a custom target has no linked app service: only
values.* resolve.
configs¶
Accessed as configs.[name].[token].
configs.[name].configMap: generated Kubernetes ConfigMap name for the named config
keys¶
Available to a service that declares a generated key in its
service.yml. Accessed as keys.[name].[field]:
keys.[name].privateKey: PKCS#8 private-key PEMkeys.[name].privateKeyBase64: base64-encoded PKCS#8 private-key PEMkeys.[name].publicKey: PKIX public-key PEMkeys.[name].publicKeyBase64: base64-encoded PKIX public-key PEMkeys.[name].fingerprint: unpadded base64url-encoded SHA-256 fingerprint of the PKIX public key
The keys namespace is available only in the owning app-service context and is not exposed under links. Environment
variables that use a private-key field must be marked secret: true.
volumes¶
Accessed as volumes.[name].[token].
volumes.[name].size: effective volume size in GBvolumes.[name].claim: generated PVC name for the named volumevolumes.[name].storageClassName: configured Kubernetes storage class. An unset class resolves as an omitted Helm value so the cluster can apply default storage-class admission.
integrations¶
Accessed as integrations.[name].[token].
integrations.[name].key: integration key or secret valueintegrations.[name].variables.[variable-name]: exported integration variable by name