Deleting a Secret
Learn how to delete a secret stored in an OCI vault.
- Note
When a vault secret is pending deletion, resources or services that rely on that secret immediately become inaccessible. The secret also can't be rotated or otherwise updated. When the secret is deleted, it is are irreversibly destroyed. If you want to restore the use of a secret before it is permanently deleted, you can cancel its deletion.
- Open the navigation menu , select Identity & Security, and then select Vault.
- Under List scope, select a compartment that contains the secret that you want to delete.
-
On the Vaults page, click the name of the vault to open its details page.
- Click Delete Secret.
- Under Resources, click Secrets,and then click the name of the secret to open its details.
- Click Delete Secret.
- Confirm that you want to delete the vault secret by typing the secret name in the text box.
- Schedule when you want Vault to delete the secret. By default, the service schedules secrets for deletion 30 days from the current date and time. You can set a range between 1 day and 30 days.
- Click Delete Secret. If needed, you can restore use of the vault secret and access to resources and services that use the contents of that secret by clicking Cancel Deletion on the secret details page and making the secret version current again.
- Caution
When a secret is pending deletion, resources or services that rely on that secret immediately become inaccessible. The secret also can't be rotated or otherwise updated. When the secret is deleted, secret contents are irreversibly destroyed. If you want to restore the use of a secret before it is permanently deleted, you can cancel its deletion.Open a command prompt and run
oci vault secret schedule-secret-deletion
to schedule a secret's deletion:oci vault secret schedule-secret-deletion --secret-id <target_secret_id> --time-of-deletion <time_in_rfc3339_format>
For example:
oci vault secret schedule-secret-deletion --secret-id ocid1.vaultsecret.oc1.iad.exampleaz5qacpqahuecvbjqzql4qmpbrtd7pprafhivcfik6wuitexample --time-of-deletion 2020-04-30T10:00:00Z
By default, the service schedules secrets for deletion 30 days from the current date and time. You can set a range between 1 day and 30 days.
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Use the ScheduleSecretDeletion API with the Management Endpoint to schedule deletion of a secret.
Note
The Management Endpoint is used for management operations including Create, Update, List, Get, and Delete. The Management Endpoint is also called the control plane URL or the KMSMANAGMENT endpoint.
The Cryptographic Endpoint is used for cryptographic operations including Encrypt, Decrypt, Generate Data Encryption Key, Sign, and Verify. The Cryptographic Endpoint is also called the data plane URL or the KMSCRYPTO endpoint.
You can find the management and cryptographic endpoints in a vault's details metadata. See Getting a Vault's Details for instructions.
For regional endpoints for the Key Management, Secret Management, and Secret Retrieval APIs, see API Reference and Endpoints.
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.