Delete a secret
Delete a secret with every version, grant and access log entry, one at a time or many at once.
Warning
Every version is deleted and cannot be recovered. An app variable bound to the secret is left without a value: from the next rollout the app runs without that variable. A workflow job that names it fails at its next run (in GitHub Actions syntax it gets an empty value), unless the Default secret of that name remains to take its place.
Replace 5b8c1d2e-3f4a-4b6c-8d7e-9f0a1b2c3d4e with the secret's id.
Prerequisites
- Permission for
secrets:DeleteSecreton the secret. In the console, alsosecrets:ListSecretsto open Secrets; without it the page says "You do not have permission to list secrets." - Not a source's credential: disconnect the source instead (see Manage a source).
- For a secret managed by Error Tracking: no app or CI environment uses it any more.
Delete one secret
- Open Secrets and choose the secret.
- In its panel, under Danger zone, choose Delete secret.
- Enter the secret's name, then choose Delete secret.
dcloud secrets secrets delete 5b8c1d2e-3f4a-4b6c-8d7e-9f0a1b2c3d4eDELETE /secrets/api/secrets/5b8c1d2e-3f4a-4b6c-8d7e-9f0a1b2c3d4eRemove the dcloud_secret resource and run terraform apply.
The answer is 200 with the deleted secret's id. Only this environment's secret of the name is
deleted.
Delete many secrets
- Open Secrets and select the secrets' check boxes.
- Choose Delete.
- Enter the confirmation the dialog asks for (
delete 3 secretsfor three), then choose Delete.
dcloud secrets secrets bulk-delete --ids 5b8c1d2e-3f4a-4b6c-8d7e-9f0a1b2c3d4ePOST /secrets/api/secrets/bulk/delete
{ "ids": ["5b8c1d2e-3f4a-4b6c-8d7e-9f0a1b2c3d4e"] }Not available in Terraform. Remove each `dcloud_secret`.
At most 500 ids per call. Each is answered on its own in { results, succeeded, failed }; the call
is not atomic.
Refusals
409"This is the credential of the secret source "name". Disconnect the source instead". In a bulk delete, that item fails with "The credential of the source "name". Disconnect the source instead".409for a secret managed by Error Tracking that an app or CI environment still uses, naming where to disconnect it.403withoutsecrets:DeleteSecret.