Updating a Secret to a New Version

Update a secret content to a new secret version in OCI Vault service.

    1. Open the navigation menu, click Identity & Security, and then click Vault.
    2. Under List Scope, in the Compartment list, click the name of the compartment that contains the vault with the secret you want to provide with new secret contents.
    3. From the list of vaults in the compartment, click the vault name.

    4. Click Secrets, and then click the name of the secret with the secret contents you want to update. (If needed, first change the list scope to the compartment that contains the secret.)
    5. Click Create Secret Version. (You can only create a new secret version for a secret that's not pending deletion.)
    6. Specify the format of the secret contents you're providing by choosing a template type from the Secret Type Template list. (You can provide secret contents in plain-text when you use the Console to create a secret or secret version, but secret contents do need to be base64-encoded before they're sent to the service. The Console automatically encodes plain-text secret contents for you if you choose this format.)
    7. Click Secret Contents, and then enter the secret contents. (The maximum allowable size for a secret bundle is 25 KB.)
    8. If you don't want to immediately promote the new secret version to current, select the Set to Pending check box. Otherwise, this new secret version is automatically promoted as the current version.
    9. Click Create Secret Version.
  • Open a command prompt and run oci vault secret update-base64 to update a secret's contents to create a new secret version:

    oci vault secret update-base64 --secret-id <target_secret_id> --secret-content-content <base64_encoded_secret_content>

    For example:

    
    oci vault secret update-base64 --secret-id ocid1.vaultsecret.oc1.iad.exampleaz5qacpqahuecvbjqzql4qmpbrtd7pprafhivcfik6wuitexample --secret-content-content bXluZXdwYXNzd29yZA==

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • This task cannot be performed using the API.