I need to use vault cli. This is the path - secrets / cluster-secrets / ist /…
- 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.
- Assistant
Certainly! To add the key-value pair
"DD_ENV": "perf"to your existing secret at the pathsecrets/cluster-secrets/ist/status-updates-feusing the Vault Browser CLI, you can use thewritecommand as follows:write secrets/cluster-secrets/ist/status-updates-fe DD_ENV=perfStep-by-Step Instructions:
-
Open the Vault Portal Cloud Shell:
- Navigate to your Vault Cloud Portal and open the Cloud Shell environment where you can execute CLI commands.
-
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.
-
-
Verify the Update:
-
To ensure that the new key-value pair has been added successfully, you can read the secret using the
readcommand:read secrets/cluster-secrets/ist/status-updates-fe -
Output:
- You should see the existing values along with the newly added
"DD_ENV": "perf"entry.
- You should see the existing values along with the newly added
-
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 thewritecommand as shown should work for your setup.
- 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.,
-
Overwriting Data:
- The
writecommand 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.
- The
-
Help and Further Guidance:
- If you encounter any issues or need more information about available commands, you can always type
helpin the Vault Browser CLI for additional guidance.
- If you encounter any issues or need more information about available commands, you can always type
If you have any further questions or need additional assistance, feel free to ask!
-