A DevOps engineer needs to write a new secret to the KV v2 engine at path 'secret/data/team' with key 'api_key' and value 'abc123'. Which Vault CLI command achieves this?
Trap 1: vault kv put secret/data/team api_key=abc123
Incorrect because the mount path is 'secret/', so the full path becomes 'secret/team' (the 'data/' is automatically inserted by Vault).
Trap 2: vault write secret/data/team api_key=abc123
Incorrect; 'vault write' is not the recommended way for KV v2, and the path is redundant.
Trap 3: vault write secret/team api_key=abc123
Incorrect command; 'vault write' is generic and not recommended for KV v2. Also, the path should be 'secret/data/team'.
- A
vault kv put secret/data/team api_key=abc123
Why wrong: Incorrect because the mount path is 'secret/', so the full path becomes 'secret/team' (the 'data/' is automatically inserted by Vault).
- B
vault kv put secret/team api_key=abc123
Correct command; 'vault kv put' writes to KV v2 engine at the specified path (mount path is 'secret/', the secret is 'team').
- C
vault write secret/data/team api_key=abc123
Why wrong: Incorrect; 'vault write' is not the recommended way for KV v2, and the path is redundant.
- D
vault write secret/team api_key=abc123
Why wrong: Incorrect command; 'vault write' is generic and not recommended for KV v2. Also, the path should be 'secret/data/team'.