deploy.env.secureMove plain variables into secrets, without the values leaving the platform
Each named variable must hold a plain value. Its value becomes a new secret under a KMS key, granted to the deploy consumer and bound to the variable in one transaction; the plain value is no longer stored. Security Posture offers this as the fix for a credential kept as a plain variable. Saving does not restart the app. Pass redeploy: true to roll the live deployment’s own source onto the new configuration (also needs deploy:DeployApp); otherwise the response and GET …/env report pending until someone redeploys.
Depending on the resource, the call checks secrets:CreateSecret, deploy:DeployApp instead; hold all of them to be sure it is allowed.
Request syntax
POST /deploy/api/apps/{id}/env/secure
{
"keys": "array of string",
"keyId": "string",
"redeploy": "boolean"
}Path parameters
idRequiredstring
Constraints: uuid
Request body
keysRequiredarray of string
Plain variables whose values move into new secrets
Constraints: 1-128 chars, /^[A-Za-z_][A-Za-z0-9_]*$/
keyIdOptionalstring
KMS key the new secrets are encrypted under; default the organization’s default key
Constraints: uuid
May be null.
redeployOptionalboolean
Also roll the live deployment onto the new environment; default false
Response
200 with `data`: `applied` and `plan` (per key, the secret created). The top-level `redeploy` is null unless redeploy was requested; then { ok: true, deploymentId, generation, reusedDeploymentId } or { ok: false, error }. A variable that is missing is 404, one that holds no plain value 409.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Fields of data
appliedAlwaysboolean
Always true on successplanAlwaysobject
The planplan.itemsAlwaysarray of object
Per key, what happens to itplan.items[].keyAlwaysstring
Variable nameplan.items[].kindAlwaysone of plain, secret, reference, existing-secret, removed
What it becomesplan.items[].changeAlwaysone of add, update, unchanged, remove, error
What happens to itplan.items[].reasonAlwaysstring
Why it was classified soplan.items[].detailAlwaysstring
What applying does, in a sentenceplan.items[].errorAlwaysstring, may be null
Why it cannot be applied; null if it canplan.items[].lineAlwaysnumber, may be null
Line in the file; null for a removalplan.issuesAlwaysarray of object
Lines that could not be readplan.issues[].lineAlwaysnumber
Line in the fileplan.issues[].keyAlwaysstring, may be null
Variable name, if one could be readplan.issues[].messageAlwaysstring
What is wrongplan.summaryAlwaysobject
Counts by changeplan.summary.addAlwaysnumber
Variables addedplan.summary.updateAlwaysnumber
Variables changedplan.summary.unchangedAlwaysnumber
Variables left as they areplan.summary.removeAlwaysnumber
Variables removedplan.summary.errorAlwaysnumber
Variables with an errorplan.applicableAlwaysboolean
False when any item has an error; nothing is applied then
Checked against the handlers: every route test validates their answers against this schema.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow deploy:ManageEnv on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud deploy env secure id --keys '["example"]'curl -X POST "https://console.platform.deutschecloud.app/deploy/api/apps/id/env/secure" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"keys":["example"]}'Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_deploy_env_secure.