Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: CLI Doc improvements to example read / write. #19064

Merged
merged 11 commits into from
Aug 9, 2024
Merged
3 changes: 3 additions & 0 deletions changelog/19064.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
core/cli: Example 'help' pages for vault read / write docs improved.
```
8 changes: 8 additions & 0 deletions command/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ Usage: vault read [options] PATH

$ vault read secret/my-secret

Read entity details of a given ID:
aphorise marked this conversation as resolved.
Show resolved Hide resolved

$ vault read identity/entity/id/2f09126d-d161-abb8-2241-555886491d97
aphorise marked this conversation as resolved.
Show resolved Hide resolved

Generate dynamic AWS credentials for a my-role:

$ vault read aws/creds/my-role
aphorise marked this conversation as resolved.
Show resolved Hide resolved

For a full list of examples and paths, please see the documentation that
corresponds to the secrets engine in use.

Expand Down
12 changes: 9 additions & 3 deletions command/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ Usage: vault write [options] PATH [DATA K=V...]
it is loaded from a file. If the value is "-", Vault will read the value from
stdin.

Persist data in the generic secrets engine:
Store an arbitrary secret in the token's cubbyhole.

$ vault write secret/my-secret foo=bar
$ vault write cubbyhole/git-credentials username="student01" password="p@$$w0rd"

Create a new encryption key in the transit secrets engine:

$ vault write -f transit/keys/my-key
$ vault write -force transit/keys/my-key

The -force / -f flag allows a write operation without any input data.

Upload an AWS IAM policy from a file on disk:

Expand All @@ -64,6 +66,10 @@ Usage: vault write [options] PATH [DATA K=V...]

$ echo $MY_TOKEN | vault write consul/config/access token=-

Create a token

$ vault write auth/token/create policies="admin" policies="secops" ttl=8h num_uses=3

For a full list of examples and paths, please see the documentation that
corresponds to the secret engines in use.

Expand Down