Skip to content

Commit 5ccaf73

Browse files
committed
add a USAGE document
1 parent 6dea313 commit 5ccaf73

File tree

2 files changed

+55
-13
lines changed

2 files changed

+55
-13
lines changed

README.md

+5-13
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ The macOS release is code-signed, and you can verify this with `codesign`:
2626

2727
## Usage
2828

29+
See the [USAGE](./USAGE.md) document for more help and tips.
30+
2931
```bash
3032
# Store AWS credentials for the "home" profile
3133
$ aws-vault add home
@@ -37,17 +39,8 @@ $ aws-vault exec home -- aws s3 ls
3739
bucket_1
3840
bucket_2
3941

40-
# store credentials for the "work" profile
41-
$ aws-vault add work
42-
Enter Access Key Id: ABDCDEFDASDASF
43-
Enter Secret Key: %
44-
45-
# Execute a command using temporary credentials
46-
$ aws-vault exec work -- aws s3 ls
47-
another_bucket
48-
4942
# Inspect the environment
50-
$ aws-vault exec work -- env | grep AWS
43+
$ aws-vault exec home -- env | grep AWS
5144
AWS_VAULT=work
5245
AWS_DEFAULT_REGION=us-east-1
5346
AWS_REGION=us-east-1
@@ -59,10 +52,9 @@ AWS_SECURITY_TOKEN=%%%
5952

6053
### Backends
6154

62-
You can choose different secret storage backends, which may be particularly useful on Linux.
63-
By default, Linux uses an encrypted file. You can use your system keyring by choosing the secret-service backend which [abstracts over Gnome/KDE](https://specifications.freedesktop.org/secret-service/).
55+
You can choose among different pluggable secret storage backends. By default, Linux uses an encrypted file. You can use your system keyring by choosing the secret-service backend which [abstracts over Gnome/KDE](https://specifications.freedesktop.org/secret-service/).
6456

65-
AWS_VAULT_BACKEND=secret-service
57+
See the [USAGE](./USAGE.md) document for more help and tips.
6658

6759
## Security
6860

USAGE.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
# Help
3+
4+
aws-vault --help
5+
6+
7+
## Multiple profiles
8+
9+
```bash
10+
# Store AWS credentials for the "home" profile
11+
$ aws-vault add home
12+
Enter Access Key Id: ABDCDEFDASDASF
13+
Enter Secret Key: %
14+
15+
# Execute a command using temporary credentials
16+
$ aws-vault exec home -- aws s3 ls
17+
bucket_1
18+
bucket_2
19+
20+
# store credentials for the "work" profile
21+
$ aws-vault add work
22+
Enter Access Key Id: ABDCDEFDASDASF
23+
Enter Secret Key: %
24+
25+
# Execute a command using temporary credentials
26+
$ aws-vault exec work -- aws s3 ls
27+
another_bucket
28+
```
29+
30+
31+
## Overriding the aws CLI to use aws-vault
32+
33+
You can create an overriding script (make it higher precedence in your PATH) that looks like the below:
34+
35+
```
36+
#!/bin/bash
37+
set -euo pipefail
38+
39+
AWS_PROFILE=${AWS_DEFAULT_PROFILE:-work}
40+
exec aws-vault exec "$AWS_PROFILE" -- /usr/local/bin/aws "$@"
41+
```
42+
43+
The exec helps reduce the number of processes that are hanging around. The `$@` passes on the arguments from the wrapper to the original command.
44+
45+
46+
## Backends
47+
48+
You can choose different secret storage backends, which may be particularly useful on Linux, where you may prefer to use the system keyring with this environment variable:
49+
50+
AWS_VAULT_BACKEND=secret-service

0 commit comments

Comments
 (0)