Reference
Variables
The rules a variable must follow, what a reference looks like, what each resource exposes, and which values are secret.
Environment variables explains how variables work. These are the rules.
Names and values
| Rule | Value |
|---|---|
| Name pattern | [A-Za-z_][A-Za-z0-9_]* |
| Name length | At most 128 characters. |
| Value size | At most 32 KiB. |
| Reserved names | PORT, K_SERVICE, K_REVISION, K_CONFIGURATION. Set by the runtime; refused as a variable name on a service or an environment. |
| Uniqueness | One value per name per service, and one per name per environment. A service's own value wins over the environment's. |
Where a variable can be set
| Scope | Set on | Read by | Values allowed |
|---|---|---|---|
| Service | The service's Variables tab | That service | Literals and references |
| Environment | The environment's Variables tab | Every web service in the environment | Literals only |
References
| Syntax | ${{ <resource>.<VARIABLE> }}, for example ${{ database.DATABASE_URL }} |
| Target | A resource in the same environment as the service. Never another environment, never the service itself. |
| Resolved | When Kuppit prepares a deployment, from the target's state at that moment. Never stored. |
| Secrecy | Follows the referenced variable, whatever the referencing variable is named. |
What each resource exposes
| Resource | Variable | Secret |
|---|---|---|
| PostgreSQL | PGHOST | |
PGPORT | ||
PGUSER | ||
PGPASSWORD | Yes | |
PGDATABASE | ||
DATABASE_URL | Yes | |
| Web service | Nothing |
The shape of each value is on reaching a database.
Secrets
| Marking | Per variable, on creation or afterwards. |
| Reading back | Never. The dashboard shows the name only. |
| Changing | Enter a complete replacement; saving overwrites the previous value for future deployments. |
| In logs | The service's secret values are redacted from every log line before it is shown. |
| Copied to a preview | Only when Give previews the production secrets is on for the project. |
| Copied to a named environment | Only the ones ticked by name when the environment is created. |
When a change takes effect
At the next deployment, never on the running one. The service shows Runtime configuration has changed until it is redeployed. A rollback restores the variables the earlier deployment ran with.
Was this page helpful?