eb2147c7159cf1ed14b1e5b6784d7d07c3662b52
- Author
- Noam Cohen <noam@noam.me>
- Committer
- GitHub <noreply@github.com>
- Date
Message
feat(aws): load profiles from credentials file (#11196)
Fixes #8472
Diff
1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
2index 2167f552cd4b5365e6d410f653fa08a793816a2e..865e82f193c88fef40c190e4de6170fe6c189ad6 100644
3--- a/plugins/aws/aws.plugin.zsh
4+++ b/plugins/aws/aws.plugin.zsh
5@@ -146,6 +146,7 @@ function aws_change_access_key() {
6 }
7
8 function aws_profiles() {
9+ aws --no-cli-pager configure list-profiles 2> /dev/null && return
10 [[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1
11 grep --color=never -Eo '\[.*\]' "${AWS_CONFIG_FILE:-$HOME/.aws/config}" | sed -E 's/^[[:space:]]*\[(profile)?[[:space:]]*([^[:space:]]+)\][[:space:]]*$/\2/g'
12 }