Apply Configuration Versions to Gateways
A control plane keeps the configuration you author and applies it to the gateways it administers, the ThunderID deployments that serve your users. You capture the configuration as a version, compare the version with what a gateway holds, and apply it. Each gateway records the version it holds, so you can revert it to the one it held before.
Prerequisites
- ThunderID running locally. See Get ThunderID.
- A gateway registered on the control plane through
POST /gateways. - An access token with the root system permission (the
systemscope by default). Every route on this page requires it.
Capture a Version
POST /configuration-versions exports the configuration as it stands and keeps it as a version. Users
and groups are included. The body is optional and takes a name and a note.
curl -X POST https://localhost:8090/configuration-versions \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"name": "Spring release", "note": "Added the payments application"}'
A version is named by the SHA-256 hash of the exported documents as written, with their references or
placeholders, not the values those stand for. Values differ from one gateway to the next, so a change
to a value alone is not a new version. Any prefix of at least seven characters that no other version
shares also names it, and so does latest.
- Capturing unchanged configuration keeps nothing new. When the configuration matches the latest
version, the answer is
200with that version, markedunchanged, instead of201. - Going back is a new version. When the configuration goes back to what an older version holds, for
example after a change is undone, the capture keeps a new version, the latest, with the same hash as
the older one. Applying
latestthen undoes the change on a gateway too. A hash shared by two versions names the newer one. - A resource the export cannot write is left out. For example, a user with no username. The answer
lists it under
skippedwith the reason. - A version holds references, not values. A client secret or a user's password appears as a
value reference such as
sec:APPLICATION__0198F3A17C2E7B109A445D3E8F21C6B7__CLIENT_SECRET. The gateway fills it in from its own store when the version is applied. - The current version is kept up to date in place. A control plane captures the configuration on
its own shortly after each change to it: it waits about two seconds after the last of a run of
changes, then captures them together, and tries again later if that capture fails. Until that
capture has run,
latestis still the version before the change, so check thatlatesthas the hash you expect before applying it. That capture replaces the current version instead of adding one, until it is applied to a gateway. From the moment an apply sends it that version is kept, and it stays the current one until the next change, which starts a new current version. A listing marks the current versioncurrent. A capture with"current": truein the body does the same on request; one without it always adds a version. - A secret may stand only in a credential field. A configuration that refers to a secret from any
other field, such as a description or a redirect URI, is refused with
400(GTW-1026), naming each place the secret stands, because every gateway would refuse that resource on import. See Where a Secret May Stand. - A version names who it was captured for.
createdByholds the user'sid, from the token'ssubclaim or the claimserver.security.trusted_issuer.user_id_claimnames, and theirname, read from the trusted issuer's user API when the version is read and never stored. It is given out only whenserver.security.trusted_issuer.user_lookupis configured and the issuer knows the user: the id alone is an identifier of the issuer's that says nothing to a viewer, so otherwise the field is left out. The id is recorded either way, so a lookup configured later names the versions already captured. A capture after a change names the user who made the last change before it. - Only
gateway.max_versionsversions are kept. The oldest goes first, except a version some gateway holds or can revert to, or that a resource a gateway holds, or held in a master it keeps, was deployed from. Those are kept even when that leaves more versions than the number. See Configuration.
GET /configuration-versions lists the versions, newest first, without their content.
GET /configuration-versions/{version} returns one with its content.
Read What Each Value Is For
GET /configuration-versions/{version} returns the version's references, one entry for each place it
refers to a variable or a secret:
| Field | Description |
|---|---|
name | The name the gateway holds the value under. |
kind | variable or secret. |
resourceType, resourceId, resourceName | The resource that holds the reference. resourceName is its name, or a user's username. |
field | The field the reference stands in, or the list's field for a list item. |
list | Set when the reference is a list's item. The value then holds the list's items as a JSON list of strings. |
To read the configuration as it stands without capturing it, use current as the version:
curl https://localhost:8090/configuration-versions/current \
-H "Authorization: Bearer <access_token>"
The answer has the references, resources and skipped a capture would keep, and the version hash
a capture would give it, which equals the latest version's when nothing has changed since. It has no
name or note. Each read runs a full export, so read it when you need it rather than polling it.
Compare a Version With a Gateway
GET /gateways/{id}/diff?version=<version> reports what applying the version would add, update and
remove, without contacting the gateway. The version defaults to latest.
Each entry in changes names a resource, its change (added, updated, deleted or unchanged), and
a key such as application/550e8400-e29b-41d4-a716-446655440000. Each change also carries lines, the
resource's document compared line by line, and needs, the keys of the resources it names by id (see
Deploy a Resource With What It Needs). The documents hold
references, so a diff never shows a secret value. A user's attribute values are masked as ********, all
but its username, so a diff shows which attributes changed without showing what they hold.
GET /gateways/{id}/applied-version reports the version the gateway holds and the one a revert returns
it to, with when it was applied and who applied it (appliedAt, appliedBy, the latter under the same
rule as createdBy). complete says whether the gateway holds that version whole; see
Partly Applied Versions.
A version captured before captures refused a misplaced secret may still refer to one from a field that
holds no credential. The diff lists each such place under misplacedSecrets, in the same shape as
references, so the resource can be put right and captured again before the gateway refuses it. A dry
run reports the same under diff.misplacedSecrets.
Apply a Version
POST /gateways/{id}/apply sends the version to the gateway's import API with the gateway's key.
curl -X POST https://localhost:8090/gateways/<gateway_id>/apply \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"version": "latest"}'
The version is sent to the gateway's managed import, so what it deploys is read only on the gateway: its own console and APIs refuse to change it, and only a later apply does. Upgrade a gateway before the control plane that deploys to it. A gateway on a release without the managed import answers 404 for it, and the control plane sends the same import to the gateway's plain POST /import instead. That deploy succeeds, but what it writes is editable on that gateway. Upgrading the gateway does not make it read only: a resource is marked only when a managed import writes it, and an apply sends only what changed, so each of these resources stays editable until the control plane next deploys a change to it. The result of such an apply carries "plainImport": true, and the control plane logs a warning.
Only what differs is sent: the resources the gateway's master says it lacks or holds in another form, and the removal of what the master records that the version no longer has. A resource the gateway holds as the version has it is not sent again, and the control plane never removes something it did not deploy. An apply with nothing to send does not call the gateway.
A role or group the version no longer lists someone in is sent with the removal of that assignee or
member. Only who the master records is taken off: an assignee or member the gateway added itself,
such as through a registration flow, stays. When the gateway refuses the removal, the master records
the role or group as failed, and the next apply sends the removal again. A gateway on a release
without these removals refuses them as unsupported, so the role or group stays failed until the
gateway is upgraded. These removals do not count toward gateway.removal_confirmation_threshold.
- A dry run records nothing. With
"dryRun": true, the gateway imports as a dry run and the answer shows what would happen. - The gateway's own report is returned.
importin the answer lists each resource the gateway wrote or refused. A refused write or removal does not stop the version being recorded: the master records the resource asfailed, the version is recorded as partly applied, the diff offers the resource again, and the next apply sends it again. - Many removals need confirming. An apply or revert that would remove more resources than
gateway.removal_confirmation_threshold(five unless configured) is refused with409(GTW-1030). Run it as a dry run to see the removals, then send it again with"confirmRemovals": true. - A value changed since the last apply is reported, and sent.
changednames the variables and secrets the version refers to that were set on the gateway again since the version it holds was applied, with where the version refers to each, asmissingdoes. Values are never shown. The resources that refer to such a value are sent again, so the gateway reads the new value although no document changed, and thediffin the apply's answer marks themupdatedwith"valueChanged": true. Only an apply reads the gateway's store, soGET /gateways/{id}/diffcannot report them: run the apply as a dry run to see them before you build aselection. While aselectionleaves such a resource out, the value stays reported as changed, and the next apply offers the resource again. The time the gateway's store gives for each value is compared with the time it gave at the last apply, so the control plane's clock plays no part. A value the control plane sent itself, such as a secret captured from a resource, is reported too, since it also takes effect outside any version. - One apply at a time per gateway, and the latest version is never lost. Applies and reverts to the
same gateway run one at a time across every control plane node. While one runs, an apply that asks
for
latestwith nothing selected and nothing confirmed is not run or refused but queued: the answer is202withqueuedandqueuedVersion, and once the running apply finishes the latest version at that moment is applied, for the user who asked, so a burst of changes costs one more apply. What that later apply would refuse for its removals is refused now instead. The queued apply is best effort: it is not kept if the node running it restarts, and a failure is logged rather than answered, so read the gateway's applied version to see what it holds. An apply of a version named by its hash, a confirmed one, or a revert waits for the running apply, and is refused with409(GTW-1029) if it is still running after as long as an import may take. - An apply that took too long to prepare sends nothing. An apply that has not sent its import
within the time its lease allows for one sends nothing and is answered with
503(GTW-5003), so its import can never overlap one from an apply that took the lease over. Apply again. - Each apply records the gateway's master.
masterin the answer is the hash of the master the gateway holds after the apply, which records every resource as the gateway accepted or refused it, described in Read What a Gateway Holds, Resource by Resource. An apply that changes nothing the master records, such as one repeated, keeps the master the gateway has rather than adding the same one again. The master and the version recorded as applied are written in one transaction, and only while the apply still holds the gateway's lease. When another node took an apply's lease over, that apply records neither and is answered with409(GTW-1019). Anorigingiven in the request, such as the name of the environment the version came from, is recorded on each resource the apply writes. It is at most 255 characters; a longer one is answered with400(GTW-1035). A promotion through the MCPpromote_gatewaytool gives the source gateway's ID as the origin.
Missing Values
The gateway must hold a value for every variable and secret the version refers to. Before anything is sent, the control plane asks the gateway's store for each name.
- A dry run lists the names the gateway lacks under
missing, asvariablesandsecrets.missing.referencessays what each one is for: the resource that refers to it and the field it stands in, as described in Read What Each Value Is For. A dry run names the values of every change the version offers, one the gateway holds back included, so a caller can ask for the values its selection needs. An apply checks only the resources it sends: one the gateway already holds as it is, or one left out of the selection, needs no value yet. - An apply is refused with
409(GTW-1017) until the gateway holds them all. Nothing is sent and nothing is recorded.
Set the missing values through the control plane, as described in Manage a Gateway's Values, then apply again.
Deploy Only Selected Changes
selection lists the keys of the changes to send in this apply. Every other change stays on offer: a
resource left out is neither written nor removed, and the next diff reports it again. This is how one
resource, or a few together, are deployed without the whole version.
{
"version": "latest",
"selection": ["application/550e8400-e29b-41d4-a716-446655440000"]
}
- Omitted, every change the diff reports is sent, except those held back (see below).
- Empty (
[]), nothing is sent; the version is recorded as partly applied, or as applied when the gateway already holds it whole. - A selection is for this apply alone. The answer's
diffmarks the changes it sent with"selected": true. - A key the diff does not report is refused with
400(GTW-1025), so a typo or a key from an older diff never leaves out a resource you meant to send. Naming a resource that did not change is allowed; there is nothing to send for it. - Missing values are checked for what is sent. A resource left on offer needs no value yet.
Keep a Change Out of Later Applies
To keep a change out of the applies after this one too, name it in leaveOut. The gateway then holds it
back: later diffs report it with "heldBack": true, and an apply without a selection leaves it out
again. An apply whose selection names it sends it and stops holding it back. Each gateway keeps its own,
so what one gateway holds back does not affect another.
{
"version": "latest",
"selection": ["application/550e8400-e29b-41d4-a716-446655440000"],
"leaveOut": ["flow/0190a7c2-6b1e-7f3a-9d42-5c8e1f2b3a4d"]
}
A key in leaveOut that the diff does not report, or that the selection also names, is refused with
400 (GTW-1025).
Partly Applied Versions
An apply whose selection leaves changes out, or whose import the gateway refuses in part, records the
version all the same, as partly applied. No version is made up for the state in between: the gateway's
master is that state. GET /gateways/{id}/applied-version then answers with "complete": false, the
master the apply left, and resourcesHeld of resourcesTotal, how many of the version's resources
the gateway holds as the version has them. A console shows this as "9f3c4a1 partly applied: 3 of 5
resources". The diff goes on offering the rest, and the apply that brings the gateway level with the
version, sending the rest or retrying what was refused, records it with "complete": true. An apply's
own answer says the same in complete.
Deploy a Resource With What It Needs
Each change in a diff carries needs: the keys of the resources its document names by id in the
version, such as the flows and the unit an application names, the resource server a role names, or
the parent a unit names. Nothing is declared per resource type: every scalar in a document that is
the id of another document in the version counts, except the document's own id, a kind such as
type, and a value that describes the resource, such as its name, description, handle, username or
email. Resources of different types that share an id are
all counted. A resource named by name or handle is expected to be on the gateway already.
With withDependencies (on by default), a selection is widened to what the selected resources need
that the gateway lacks or holds in another form, through what those need in turn, so selecting an
application also sends its flows and its unit when the gateway does not have them. A dependency the
gateway already holds as the version has it is not sent again. The answer's diff marks a change sent
for another's sake with "required": true and requiredBy, the selected key that needed it. A dry
run shows the same, which is how a console answers "deploying this brings these too".
With "withDependencies": false, a selection whose resource needs something the gateway lacks or
refused is refused with 409 (GTW-1032), naming what is missing, before anything is sent. A
dependency the gateway holds in another form serves the selected resource, so it is not counted as
missing: replacing it is a choice of its own. A needed resource the
gateway holds back is never taken in either: with dependencies on, a selection needing one is refused
the same way until it names that resource too, which also stops holding it back.
A removal is refused with 409 (GTW-1033) while a document the gateway keeps still names the
resource by id, such as a unit whose child unit stays, so an apply never leaves a resource pointing at
nothing. Remove or update the resources that need it in the same apply, or leave it in place. A
removal that only an update in the same apply frees, such as an application updated to stop naming a
flow that the version also removes, is sent in a second import once the gateway has accepted the
update; if the gateway refuses the update, the resource stays in place and the diff offers the removal
again.
A resource deleted and created again under the same name, such as a resource server, gets a new id, so
the diff offers the old one's removal and the new one's addition. The addition names the removal in
replaces when both have the same type and name, in the same organization unit, project and parent.
A selection that names the addition takes in that removal, marked required, with or without
withDependencies and with a project too, unless the gateway holds the removal back: the new
resource is then refused for its name until a selection names the removal. The apply removes the old
resource, with what is under it, in an import of its own before the documents, since the gateway
refuses the new one while the old one holds the name. A removed resource that names the old one goes
in that import too when the apply removes it; one the apply leaves in place still names the old
resource, so the apply is refused with 409 (GTW-1033). This removal does not wait for updates that
stop naming the old resource.
One version cannot replace an organization unit's agent type and move its agents to the new one. The new agent type is refused while the old one is in the unit, the agents cannot move to an agent type the gateway does not have yet, and the old one cannot be removed while it is in use, so every apply fails the same way. Apply a version that moves the old agent type to an organization unit that has no agent type first. Then apply a version that adds the new agent type, moves the agents to it, puts the new handle in place of the old one in the allowed agent types of applications, agents, and flows, and removes the old agent type. This works only when the data plane holds those agent types, agents, applications, and flows in its database. Change those that a resource file on the data plane defines in that file instead, since an apply cannot change them and the data plane checks agents loaded from files against their agent type's organization unit when it starts. See Deletion Behavior for the same rules on a single import.
These checks read the documents the gateway is left with once the apply's updates, additions and
removals are made, so a revert that moves an application back to its earlier flow removes the flow it
no longer names. A promotion sends only what the source runs as the version has it and takes no
selection, so when that would leave a resource naming one the target does not hold, or remove one a
resource the source does not run still names, it is refused with 409 (GTW-1042), naming the source
gateway to deploy the version to first.
Deploy One Project
A diff and an apply can be scoped to one project with its id: GET /gateways/{id}/diff?project=<id>,
or "project": "<id>" in the apply's body. A project's own resources are those whose documents name it
in projectId, such as its applications and agents. Organization units, users and groups name no
project, so they are shared. Each change of the diff is then placed in a
section:
| Section | What it holds | Sent by default |
|---|---|---|
project | The project's own resources. | Yes, less what the gateway holds back. |
needed | What they name by id, followed through needs. | Only when the gateway lacks or refused it, marked "required": true. |
shared | What names no project, such as organization units, translations, branding, other flows and system users. | No, only when selected. |
other | Another project's own resources. | Never. |
A needed resource the gateway holds in another form already serves the project, so it is not required:
selecting it replaces it for every resource on the gateway that uses it. Such a needed or shared change
names those other projects in usedBy.
Without a selection, an apply scoped to a project sends its defaults. A selection may add needed and
shared changes, and is never widened. It is refused with 400 when it names another project's own
resources (GTW-1039) or leaves out a required change (GTW-1040). An unknown project is refused with
404 (GTW-1038).
GET /gateways/{id}/project-status?project=<id> reports where the project stands on the gateway: the
versions its own resources there were deployed from, when they were last written and by whom, whether
it can be rolled back, and how many of its own, needed and shared changes a deploy scoped to it would
send. Changes an earlier deploy left out, which the gateway holds back, are counted apart as
heldBack: they are not pending, but a deploy that selects them brings them. With from=<gateway id>
it compares against what promoting that gateway would send.
Each project can also be synced on its own after every capture. Set projects in the gateway server
configuration section, by project id, with autoSync and the firstGateway its pipeline starts
at. Set one project's entry with PUT /projects/{projectId}/auto-sync, which keeps every
other project's entry even when two are set at once, and remove it with DELETE on the same path. A capture then deploys, for each project whose autoSync is on
(or inherits autoApply), the changes it made to the project's own resources, what they need that the
gateway lacks, and every shared change it made. A project with autoSync off keeps its changes pending
for a deliberate deploy. autoSync in the project's status says whether it is on and how the last sync
went.
A promotion can carry only part of a version, so one gateway can hold one project's resources from one
version and another project's from another. To roll back one project, send "project": "<id>" in a
revert's body. Only that project's own resources go back to what the gateway held before the last
deploy scoped to it, and the gateway stays recorded as running its version. A project is rolled back
once until it is deployed again; one with nothing to roll back to is refused with 400 (GTW-1041).
Revert a Gateway
POST /gateways/{id}/revert returns the gateway to the master it held before the version it holds now,
which is that earlier version as far as the gateway held it: a version that was partly applied is
returned to in part, and each resource keeps the version that sent it. What that master does not hold
is removed. The master a revert returns to is kept past gateway.max_versions, and so is each project's
rollback point, so a project that has not deployed in a while can still be rolled back. A revert goes back one step only: afterwards the gateway has
no earlier version to revert to, and a second revert is refused with 400 (GTW-1016) until a later
apply. To return to the version reverted from, apply it.
A revert takes dryRun and follows the same rules as an apply: it sends only what differs between
the gateway's master and the one it returns to, and it is refused with 409 while the gateway lacks a value a
resource it sends refers to. A gateway with no earlier version answers 400 (GTW-1016).
Read What a Gateway Runs
GET /gateways/{id}/applied-configuration returns every resource the gateway's master holds, which is
what the gateway accepted, each tagged with the sourceVersion that sent it and in the shape the
resource's own read returns, such as what GET /applications/{id} returns for an
application. A console shows the configuration as the gateway runs it from this one read, rather than as
the control plane holds it now, which may have moved on since the apply.
curl -k https://localhost:8095/gateways/{id}/applied-configuration \
-H "Authorization: Bearer <token>"
{
"gatewayId": "...",
"version": "9f3c...",
"complete": true,
"appliedAt": "2026-10-09T10:00:00Z",
"resources": [
{"resourceType": "application", "id": "...", "sourceVersion": "9f3c...", "resource": {"name": "Orders", "...": "..."}},
{"resourceType": "group", "id": "...", "resource": {"name": "Admins"}, "parts": {"members": {"...": "..."}}}
],
"skipped": []
}
- A value the version refers to, such as
var:APPLICATION__0198F3A17C2E7B109A445D3E8F21C6B7__CLIENT_ID, is returned as the reference: the version does not hold the value. A secret the resource's own read masks is masked the same way, and the credentials of users and agents are never returned. partscarries the collections a resource's own API serves apart from it, as one page holding every item: a group'smembers, a role'sassignments, a resource server'sresourcesandactions, and a translation's namespaces underns/{namespace}.skippedlists the version's documents that cannot be shown as their resource:GTW-1021when the resource type cannot be shown from a version,GTW-1022when the document does not read as its resource, for instance one captured with a template range whose values are not filled in.- A gateway nothing was applied to runs nothing:
resourcesis empty and there is noversion. A version that is partly applied is shown as far as the gateway holds it, with"complete": false: a resource the gateway never accepted is not listed, and one it still runs from an earlier version carries that version as itssourceVersion.
Read What a Gateway Holds, Resource by Resource
A version is a deployment's whole configuration as designed. What a gateway runs is its master: one record per gateway of every resource deployed to it, as the gateway last accepted it, with how each one got there. Each apply writes a new master from the gateway's own account of the import, one resource at a time, and keeps the one before, so a gateway's history is its masters and a resource's history is its entry across them. A master is never sent to a gateway as a whole.
GET /gateways/{id}/master returns the master the gateway holds now.
curl -k https://localhost:8095/gateways/{id}/master \
-H "Authorization: Bearer <token>"
{
"gatewayId": "...",
"number": 3,
"master": "4c5a...",
"createdAt": "2026-10-28T09:00:00Z",
"createdBy": {"id": "...", "name": "alice"},
"resources": "resource_type: application\nid: ...\n---\n...",
"summary": {"deployed": 12, "failed": 1, "removed": 1},
"entries": [
{
"key": "application/550e8400-e29b-41d4-a716-446655440000",
"resourceType": "application",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Orders",
"contentHash": "9f3c...",
"sourceVersion": "a37b...",
"origin": "dev",
"state": "deployed",
"at": "2026-10-28T09:00:00Z",
"by": {"id": "...", "name": "alice"}
},
{
"key": "flow/...",
"resourceType": "flow",
"id": "...",
"state": "failed",
"sourceVersion": "a37b...",
"failure": {"code": "FLW-1001", "message": "..."},
"at": "2026-10-28T09:00:00Z"
}
]
}
resourcesholds every resource the gateway accepted, one document each, in the same form a version holds them, so a master can be read as a version can.entriesis the manifest, one entry per resource key, sorted by key.stateisdeployedfor a resource the gateway accepted;failedfor one the gateway refused on its last apply, withfailureas the gateway answered, whilecontentHashnames the document the gateway last accepted, if it ever did;removedfor one removed from the gateway, which has no document and stays listed until something is deployed under its key again.sourceVersionis the version the resource was last applied from, andoriginthe label that apply gave. A resource sent again as the gateway already holds it keeps both, so an apply of a whole version does not rewrite where every resource came from.- A resource the gateway's answer does not name is taken as written when the gateway refused nothing it
did not name, and recorded
failedotherwise, since it is not known. masternames the master by what it holds: each resource's content, state, source and origin. Two gateways running the same resources from the same places hold the same master.- A gateway nothing was applied to holds the empty master:
numberis 0 and the answer has noentriesorresources, which a client reads as none. A gateway that applied a version before masters were recorded is given its first master from that version, less the resources it was set to leave alone, when its master is first read.
GET /gateways/{id}/master/history lists the gateway's masters, newest first, each with its summary
but without entries or resources. As many masters are kept per gateway as versions are kept per
deployment (gateway.max_versions).
GET /gateways/{id}/master/resources/{type}/{resource} returns one resource's entry across the
gateway's masters, newest first, under history, each with the master it is from and its number.
{id} is the gateway and {type}/{resource} the resource's key as the diff names it, such as
application/550e8400-...; a resource no
master records is answered with 404 (GTW-1031).
Manage a Gateway's Values
The control plane passes requests to the gateway's own variable store, presenting the gateway's key, and returns the gateway's answer unchanged.
| Route | Gateway route |
|---|---|
GET, POST /gateways/{id}/variables | /variables |
GET, PUT, DELETE /gateways/{id}/variables/{name} | /variables/{name} |
GET, POST /gateways/{id}/secrets | /secrets |
GET, PUT, DELETE /gateways/{id}/secrets/{name} | /secrets/{name} |
As on the gateway, a secret's value is never returned, only its name and whether it is set.
curl -X PUT https://localhost:8090/gateways/<gateway_id>/secrets/APPLICATION__0198F3A17C2E7B109A445D3E8F21C6B7__CLIENT_SECRET \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"value": "<client_secret>"}'
Unused Values Are Removed
Deleting a resource leaves its variables and secrets on every gateway it was deployed to. After each apply or revert that the control plane records, it removes from that gateway's store, in the background, the values it no longer needs.
The values of a resource that still exists are always kept, whether or not it was ever deployed and however long you wait before deploying it. Deleting the resource is what lets its values go, and even then they stay for as long as a version you can still roll back to, or what a gateway runs, needs them.
A value is removed only when all of these hold:
- Its name has the form the export gives a resource's value,
<TYPE>__<ID>__<FIELD>, such asAPPLICATION__0198F3A17C2E7B109A445D3E8F21C6B7__CLIENT_SECRET. A value you named yourself, such asDATA_PLANE_URL, is never removed. - No resource in the configuration as it stands refers to it.
- No version this deployment keeps refers to it, so any version you can still apply, promote or revert to finds its values. Once a version is pruned, it cannot be applied again.
- No master the gateway keeps refers to it: what it runs now, and what a revert or a project's rollback returns it to.
- It was last set longer ago than
gateway.unused_value_grace_seconds(one hour by default), and nothing refers to it. The time is counted from when the value was last set, not from when it stopped being used, so an old value goes at the first removal after its resource is deleted. The grace keeps a value set for a resource that is being created while the removal runs. The gateway measures the age itself, on its own clock, in the same step that removes the value, and the age the control plane asks for is the grace plus the time since it started reading the gateway's values (rounded up to the second, plus one second). A value set again after that read is therefore still too young to remove, whatever the control plane's clock says, unless the removal request itself is delayed on its way to the gateway by more than about the grace (the value also ages while the removal runs, so the delay that matters is the grace plus up to two seconds of rounding, not the whole age asked for). A grace below one second, such as0, is raised to one second with a warning at startup.
A dry run never removes anything, and neither does an apply that failed or was refused. If the control plane cannot read its configuration, it removes nothing that time. A resource it could not read, such as one deleted while it was being read, keeps its values until a later removal. A removal that fails is logged and does not affect the apply, and what it left is removed after a later apply.
Removal needs a gateway that can remove values by age. A gateway running an older version cannot, so nothing is removed from it: the control plane logs a warning that the gateway needs upgrading and leaves its store as it is.
Each removal reads the whole configuration, so each control plane node cleans a gateway at most once
every gateway.unused_value_sweep_interval_seconds (five minutes by default). An apply that node
handles within that time starts no removal, and the next apply after it removes what the skipped ones
would have. The time is kept in each node's memory: with several nodes, each one removes on its own
schedule, and a node that restarts starts afresh. Set
gateway.unused_value_grace_seconds to a negative number to turn the removal off.
Deploy From the Console
The console does all of the above from one full-screen page. The Deploy button in the console's header opens it: the captured versions on the left, newest first, each marked with the gateways that run it, and a card for every registered gateway with the version it runs and when and by whom it was deployed. The newest version is marked Latest. The control plane keeps it up to date as the configuration changes, so nothing has to be captured by hand.
Deploy on a version's row opens a dialog for one gateway. It lists the resources the write would add, change, or remove, each with a checkbox to leave it out this time, and an input for every value the gateway lacks. One button sets the values and applies the version. Rollback on a gateway's card previews the changes that returning the gateway to its previous version would make, and rolls it back only when you confirm.
The dialog also lists the values set on the gateway since its last deploy, with the resources that use them, since they take effect with this deploy though no version carries them. When a deploy or a rollback would remove more resources than the control plane allows without asking, it is refused and the dialog says how many would go. Clicking again, now labelled Deploy and remove or Roll back and remove, confirms it. Changing which resources are ticked drops the confirmation, so it always covers the removals that were pointed out. A deploy or rollback to a gateway that is still applying an earlier one is refused once it has waited, and the dialog says another deploy is running, so you can try again once it finishes.
A value set on a gateway after its version was deployed, such as a client secret you regenerate, a user's password you reset, or a secret you update under Configure, does not take effect until a version is deployed again, and the version itself has not changed. The gateway's card says how many values changed since its deploy, and Redeploy on the card deploys the version the gateway runs again so they take effect. Deploy on that version's row does the same. Redeploy is disabled while no value has changed, and so is Deploy on a version every gateway already runs.
Explore on a gateway's card, or a click on the card itself, opens the gateway's explorer: a map of every resource the gateway runs, in lanes by type, with a line for each relationship between them, such as an application and the flow it signs users in with. Hovering a line names the relationship. Selecting a resource opens a panel with the variables and secrets the gateway holds for it, which can be set there; a secret is replaced, never shown. Changes apply to that gateway alone.
Configure on a gateway's card opens the variables and secrets the gateway holds, in one tab each, and names the values the version it runs refers to but the gateway does not hold.