Skip to content

Commit

Permalink
docs: modernize Homebrew/macOS instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>
  • Loading branch information
Volatus committed Apr 13, 2023
1 parent 1963cf4 commit 63a8948
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,23 @@ The Homebrew formula installs a launchd job which can be used to automatically
rotate your IAM keys daily. Unfortunately, Homebrew forumlae cannot
automatically start launchd jobs, so you must manually enable it:

```
```sh
brew services start aws-rotate-iam-keys
```

A default/global configuration file for the launchd job is installed to:

```
/usr/local/etc/aws-rotate-iam-keys
```sh
$(brew --prefix)/etc/aws-rotate-iam-keys
```

This default configuration rotates keys for your default AWS profile only.
To customise the configuration, for example to rotate multiple keys, create a
copy of this file named `.aws-rotate-iam-keys` in your home directory and edit
it, e.g.

```
cp /usr/local/etc/aws-rotate-iam-keys ~/.aws-rotate-iam-keys
```sh
cp $(brew --prefix)/etc/aws-rotate-iam-keys ~/.aws-rotate-iam-keys
nano ~/.aws-rotate-iam-keys
```

Expand All @@ -221,24 +221,24 @@ multiple lines to the configuration, e.g.
If you do customise the configuration, you can test that it works by restarting
the service:

```
```sh
brew services restart aws-rotate-iam-keys
```

That's it. Your keys should have been rotated, and will now be rotated every
day for you. You can use the AWS CLI to check that your access keys have been
rotated as expected, e.g.

```
```sh
aws iam list-access-keys --profile default
```

If it hasn't worked, check the MacOS system log for error entries matching
`aws-rotate-iam-keys`. If you can't find anything useful, the launchd job also
writes output to a file in the `/tmp` directory matching the job name, e.g.
writes output to a file in the `$(brew --prefix)/var/log` directory matching the job name, e.g.

```
/tmp/homebrew.mxcl.aws-rotate-iam-keys.log
```sh
cat /opt/homebrew/var/log/homebrew.mxcl.aws-rotate-iam-keys.log
```

### Other Linux
Expand Down Expand Up @@ -307,4 +307,4 @@ PowerShell script file: `MD5 ${WIN_MD5}`

## Changes to this file

${TEMPLATE_DISCLAIMER}
${TEMPLATE_DISCLAIMER}

0 comments on commit 63a8948

Please sign in to comment.