From 58f5f253252ae792f63c4e5ea313c013c93e04fc Mon Sep 17 00:00:00 2001 From: root Date: Fri, 17 Apr 2020 11:15:12 +0200 Subject: [PATCH] Added awslogin function, that uses saml2aws --- zsh.d/50-functions.zsh | 6 +++--- zsh.d/zshfunctions/awslogin | 11 +++++++++++ zsh.d/zshfunctions/awslogin.zwc | Bin 0 -> 1136 bytes 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 zsh.d/zshfunctions/awslogin create mode 100644 zsh.d/zshfunctions/awslogin.zwc diff --git a/zsh.d/50-functions.zsh b/zsh.d/50-functions.zsh index 42eb961..1e2e1c6 100644 --- a/zsh.d/50-functions.zsh +++ b/zsh.d/50-functions.zsh @@ -19,11 +19,11 @@ autoload -U bak # fancyTerm - returns true if we are on xterm/rxvt/screen, elsewhere false autoload -U fancyTerm -# repo_char - returns a character based on the type of repo we are in -autoload -U repo_char +# # repo_char - returns a character based on the type of repo we are in +# autoload -U repo_char -# repo_char - returns a character based on the type of repo we are in autoload -U x509 +autoload -U awslogin # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/zshfunctions/awslogin b/zsh.d/zshfunctions/awslogin new file mode 100644 index 0000000..2bff1a5 --- /dev/null +++ b/zsh.d/zshfunctions/awslogin @@ -0,0 +1,11 @@ +if [[ -z "$1" ]] +then + unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_EB_PROFILE + echo AWS profile cleared. + return +fi +saml2aws login -a $1 -p $1 +eval $(saml2aws script -a $1 -p $1 --skip-prompt) +export AWS_DEFAULT_PROFILE=$1 +export AWS_PROFILE=$1 +export AWS_EB_PROFILE=$1 diff --git a/zsh.d/zshfunctions/awslogin.zwc b/zsh.d/zshfunctions/awslogin.zwc new file mode 100644 index 0000000000000000000000000000000000000000..1ec5cdd25b51ee37768accd2f003aab5b1c8043b GIT binary patch literal 1136 zcmd5)%}N_l7(H{xD9DHkUAPD`i(&Kpb-7x{pT9CC z7gnKLWSrqJA!<7JYoD^Npt>dh?Ox>PK^$c@??V>GZ-WRdZcwXO&}W>T0!|%r^W-@1 zOas!|XyyQ$lP{d#BOVgF#4$0-H?Q-T(h2ee?jgE(EQrD*LfSMD+@Z5i&`~&ivjHFQ_WN*@Aq&dGsBYQU*<`nzb z_U%4$Hqpp;G^ih;7iBs}bP0g-Z2eLQOh;wdfjtkBI@0%YJ Cm%nEK literal 0 HcmV?d00001