Skip to content
TheChatArchiveThe Chat Archive
o1-mini-2024-09-12· OpenAIAi2 WildChat-4.8M (AI2)

I need to use vault cli. This is the path - secrets / cluster-secrets / ist /…

  1. User

    I need to use vault cli. This is the path - secrets / cluster-secrets / ist / status-updates-fe

    There is already some values in the file. I need to add this portion as well - "DD_ENV": "perf". Give me the script for this. I will run this in vault portal cloud shell so I need to use vault cli - This is what I see in the CLI - The Vault Browser CLI provides an easy way to execute common Vault CLI commands, such as write, read, delete, and list. It does not include kv v2 write or put commands. For guidance, type help.

    Examples:

    → Write secrets to kv v1: write /my-secret foo=bar

    → List kv v1 secret keys: list /

    → Read a kv v1 secret: read /my-secret

    → Mount a kv v2 secret engine: write sys/mounts/ type=kv options=version=2

    → Read a kv v2 secret: kv-get /secret-path

    → Read a kv v2 secret's metadata: kv-get /secret-path -metadata

    This is the configuration for clusters-secrets.

    Ask me any questions.

  2. Assistant

    Certainly! To add the key-value pair "DD_ENV": "perf" to your existing secret at the path secrets/cluster-secrets/ist/status-updates-fe using the Vault Browser CLI, you can use the write command as follows:

    write secrets/cluster-secrets/ist/status-updates-fe DD_ENV=perf
    

    Step-by-Step Instructions:

    1. Open the Vault Portal Cloud Shell:

      • Navigate to your Vault Cloud Portal and open the Cloud Shell environment where you can execute CLI commands.
    2. Execute the Write Command:

      • Run the following command to add the "DD_ENV": "perf" key-value pair to your secret:

        write secrets/cluster-secrets/ist/status-updates-fe DD_ENV=perf
        
      • Explanation:

        • write: The CLI command used to create or update secrets.
        • secrets/cluster-secrets/ist/status-updates-fe: The path to your existing secret where you want to add the new key-value pair.
        • DD_ENV=perf: The key-value pair you are adding to the secret.
    3. Verify the Update:

      • To ensure that the new key-value pair has been added successfully, you can read the secret using the read command:

        read secrets/cluster-secrets/ist/status-updates-fe
        
      • Output:

        • You should see the existing values along with the newly added "DD_ENV": "perf" entry.

    Notes:

    • KV Version Consideration:

      • The command above assumes you are using the KV version 1 secret engine. If your secret engine is KV version 2, the path structure might differ slightly (e.g., data/ prefix). However, based on the information provided, using the write command as shown should work for your setup.
    • Overwriting Data:

      • The write command will add the new key-value pair without affecting the existing data in the secret. Ensure that the key (DD_ENV) does not already exist to prevent unintentional overwrites.
    • Help and Further Guidance:

      • If you encounter any issues or need more information about available commands, you can always type help in the Vault Browser CLI for additional guidance.

    If you have any further questions or need additional assistance, feel free to ask!