summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCristian Măgherușan-Stanciu <cristian.magherusan-stanciu@here.com>2014-07-30 14:59:00 +0200
committerMarc Cornellà <marc.cornella@live.com>2019-03-24 19:50:41 +0100
commit4f4985fddc632a1d9745aec94ce95bea10006f97 (patch)
tree61b2209dd79980410cbe7994acf90b2d4ce15e66 /plugins
parent8cbdd79517d710e5bab6ce7aca0754b37462f2ee (diff)
downloadzsh-4f4985fddc632a1d9745aec94ce95bea10006f97.tar.gz
zsh-4f4985fddc632a1d9745aec94ce95bea10006f97.tar.bz2
zsh-4f4985fddc632a1d9745aec94ce95bea10006f97.zip
aws: added an alias for changing the AWS access key set on a profile
Diffstat (limited to 'plugins')
-rw-r--r--plugins/aws/aws.plugin.zsh17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 944557e14..7005af2d6 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -14,10 +14,25 @@ function asp {
fi
}
+function aws_change_access_key {
+ if [[ "x$1" == "x" ]] then
+ echo "usage: $0 <profile.name>"
+ return 1
+ else
+ echo "Insert the credentials when asked."
+ asp $1
+ aws iam create-access-key
+ aws configure --profile $1
+ echo "You can now safely delete the old access key running 'aws iam delete-access-key --access-key-id ID'"
+ echo "Your current keys are:"
+ aws iam list-access-keys
+ fi
+}
+
function aws_profiles {
reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
}
-compctl -K aws_profiles asp
+compctl -K aws_profiles asp aws_change_access_key
# AWS prompt