feat(aws): add option to force AWS display (#3720)

* add option to force AWS display

Even if no credentials or credential_process have been setup

* change README wording

* Include sso_start_url in the description

* Change option name to force_display
This commit is contained in:
Alex Douze
2022-03-25 22:30:36 +01:00
committed by GitHub
parent 538329d9b4
commit e04f126a10
3 changed files with 49 additions and 11 deletions
+15 -10
View File
@@ -274,7 +274,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile when
credentials, a `credential_process` or a `sso_start_url` have been setup. This is based on
credentials, a `credential_process` or a `sso_start_url` have been setup. Alternatively, you can force this
module to show the region and profile event when the credentials have not been setup
with the `force_display` option. This is based on
`AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with
`~/.aws/config` file. This module also shows an expiration timer when using temporary
credentials.
@@ -284,6 +286,8 @@ The module will display a profile only if its credentials are present in
`~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`,
`AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will
also suffice.
If the option `force_display` is set to `true`, all available information will be
displayed even if the conditions above are not respected.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile
is read from the `AWS_VAULT` env var and the credentials expiration date
@@ -298,15 +302,16 @@ date is read from the `AWSUME_EXPIRATION` env var.
### Options
| Option | Default | Description |
| ------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------- |
| `format` | `'on [$symbol($profile )(\($region\) )(\[$duration\])]($style)'` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. |
| `region_aliases` | | Table of region aliases to display in addition to the AWS name. |
| `profile_aliases` | | Table of profile aliases to display in addition to the AWS name. |
| `style` | `"bold yellow"` | The style for the module. |
| `expiration_symbol` | `X` | The symbol displayed when the temporary credentials have expired. |
| `disabled` | `false` | Disables the `AWS` module. |
| Option | Default | Description |
| ------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `format` | `'on [$symbol($profile )(\($region\) )(\[$duration\])]($style)'` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. |
| `region_aliases` | | Table of region aliases to display in addition to the AWS name. |
| `profile_aliases` | | Table of profile aliases to display in addition to the AWS name. |
| `style` | `"bold yellow"` | The style for the module. |
| `expiration_symbol` | `X` | The symbol displayed when the temporary credentials have expired. |
| `disabled` | `false` | Disables the `AWS` module. |
| `force_display` | `false` | If true displays info even if `credentials`, `credential_process` or `sso_start_url` have not been setup. |
### Variables